DAuth Verification
The ETH address for the verification key in testnet is:
0xf3b4e49Fd77A959B704f6a045eeA92bd55b3b571
Verification Sample Code
1. Proof Verification
DAuth/core provide a "verifyProof" method to verify proof. The term "proof" in this context refers to a piece of evidence or verification that includes both the signed data and the metadata associated with the signature.
The following is the source code for verifyProof, you can implement it in your preferred language.
2. JWT Verification
jwt document
when using dauth with sign_mode jwt, after user authentication, a JWT token is returned.
Inside JWT token's payload, there are multiple fields including:
fields inside payloads:
alg: algorithm using for signing JWT, which is RS256.
sub: subject or user that passes authentication, it is a kecc256 hash of user account
idtype: account type
iss: issuer
aud: audience
iat: JWT issued time
exp: JWT expired time, usually it is 1 hour(3600 seconds) after iat
To use JWT token in your own code:
first find a suitable JWT library for your programming language and your framework here: https://jwt.io/libraries
then, Get JWT public key here: https://demo-api.dauth.network/dauth/sdk/v1.1/jwks.json
With the library and public key, you can call verify:
verifies whether JWT is signed by the owner of the public key,
verifies whether JWT token expired,
extract all data inside payload
Last updated