Created
January 30, 2022 23:40
-
-
Save MeetMartin/58e2b7ecf60f02af0a0563b0c3385c08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { authentication } from 'didauth'; | |
const payload = { | |
clientId: 'client id', // client id provided by MATTR | |
clientSecret: 'client secret', // client secret provided by MATTR | |
tenant: 'your-tenant.vii.mattr.global', // your tenant provided by MATTR | |
did: 'did:method:code', // your verifier DID representing your application created in MATTR platform | |
challengeId: 'your-challenge-id', // custom ID provided by your application to connect request internally | |
templateId: 'presentation template id', // presentation template ID created in MATTR platform | |
callbackURL: 'https://your-domain.tld/didauth/callback' // callback url of your website that the digital wallet will call | |
}; | |
authentication(payload) | |
.trigger | |
(errors => console.log(errors) || ({ | |
statusCode: 500, | |
body: 'Internal Server Error' | |
})) | |
(JWSURL => ({ | |
statusCode: 301, | |
headers: { | |
locations: JWSURL | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment