uport-project / ethr-did

Create ethr DIDs
Apache License 2.0
259 stars 53 forks source link

(node:16799) UnhandledPromiseRejectionWarning: Error: Signature invalid for JWT #34

Closed hsnhrn closed 4 years ago

hsnhrn commented 5 years ago

Describe the bug I am using ethr-did to verify a jwt. I sign the JWT and then verify it using..

const {payload, issuer} = ethrDid.verifyJWT(jwt)

but it is giving me that error back that : Signature invalid for JWT

To Reproduce Steps to reproduce the behavior:

  1. clone the project https://github.com/hsnhrn/did 2.to run type npm start

Expected behavior Should print kp , signed JWT and verified JWT response on console

Additional context Ethr-did version is 1.1.0. And i am using an Ethereum Blockchain called volta with registry already deployed.

mirceanis commented 5 years ago

can you share some details about how to connect to this network?

hsnhrn commented 5 years ago

Only parity client is supported with this network.. you can use the network with latest parity by adding--chain="volta" In case you need RPC here is the link https://energyweb.atlassian.net/wiki/spaces/EWF/pages/703201459/Volta+Connecting+to+Remote+RPC

The faucet to get ether https://voltafaucet.energyweb.org/ The etherscan is https://volta-explorer.energyweb.org/

aldigjo commented 4 years ago

@hsnhrn Do you get a tx hash after calling createSigningDelegate?

hsnhrn commented 4 years ago

@aldigjo Yes.

mirceanis commented 4 years ago

@hsnhrn I think this may be just a timing issue. Can you try to introduce a few seconds of delay between createSigningDelegate and verifyJWT ?

If this does not work, please paste a JWT that is failing verification.

hsnhrn commented 4 years ago

@mirceanis Yeah that works fine, Thanks a lot!