-
Notifications
You must be signed in to change notification settings - Fork 233
feat(openid4vc-client): openid authorization flow #1384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(openid4vc-client): openid authorization flow #1384
Conversation
4bdae38
to
1936f95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Mostly some small stylistic suggestions
Seems DCO is failing BTW |
Codecov Report
@@ Coverage Diff @@
## main #1384 +/- ##
=======================================
Coverage 81.84% 81.85%
=======================================
Files 788 788
Lines 19408 19445 +37
Branches 3151 3162 +11
=======================================
+ Hits 15884 15916 +32
- Misses 3517 3522 +5
Partials 7 7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
e4eddae
to
2976bd9
Compare
Thanks, @TimoGlastra. I've processed your comments. You were right, the two implementations had huge overlaps, and I've merged them together in the service. I did create two separate methods in the API. I figured that is a clearer API than optional values depending on the flow type. Regarding the
|
Signed-off-by: Karim Stekelenburg <karim@animo.id>
The "@sphereon/openid4vci-client" dependency has been updated from version 0.3.6 to 0.4.0, and "@sphereon/ssi-types" has been updated from version 0.8.1-next.123 to 0.9.0. This update includes bug fixes and new features. Signed-off-by: Karim Stekelenburg <karim@animo.id>
This commit adds a method to request a credential using the authorization flow. Additionally, the following to helper methods are added: - to generate a code verifier - to construct the authorization url (this url is to be visited by the user) Signed-off-by: Karim Stekelenburg <karim@animo.id>
The package.json file now includes two new dependencies, "@stablelib/random" and "@stablelib/sha256". These dependencies are added to improve the security of the application. In the openid4vc-client.e2e.test.ts file, a typo in the "acquireAccessTokenResponse" variable name has been fixed. Signed-off-by: Karim Stekelenburg <karim@animo.id>
The ts-ignore comment was removed as it is not recommended to use it in the codebase. The code was refactored to remove the comment and ensure that the code is type-safe. Signed-off-by: Karim Stekelenburg <karim@animo.id>
…thod call on codeVerifier property in debug log message Signed-off-by: Karim Stekelenburg <karim@animo.id>
feat(openid4vc-client): use Hasher from @aries-framework/core to hash codeVerifier Signed-off-by: Karim Stekelenburg <karim@animo.id>
…alidation before assertCredentialHasFormat call Signed-off-by: Karim Stekelenburg <karim@animo.id>
…t with a variable named credentialFormat in acquireCredentialsUsingProof method. Signed-off-by: Karim Stekelenburg <karim@animo.id>
…in acquireCredentialsUsingProof method call Signed-off-by: Karim Stekelenburg <karim@animo.id>
…eter from verifyCredential method feat(W3cCredentialServiceOptions.ts): add verifyRevocationState parameter to VerifyCredentialOptions interface refactor(OpenId4VcClientService.ts): pass verifyRevocationState parameter as an object property to verifyCredential method in W3cCredentialService Signed-off-by: Karim Stekelenburg <karim@animo.id>
… arguments to an object for better readability Signed-off-by: Karim Stekelenburg <karim@animo.id>
… in TypedArrayEncoder.toBase64URL() method call Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Karim Stekelenburg <karim@animo.id>
…d to requestCredentialUsingPreAuthorizedCode and add flowType parameter feat(OpenId4VcClientApi.ts): add requestCredentialUsingAuthorizationCode method and flowType parameter refactor(OpenId4VcClientService.ts): rename requestCredential2 to requestCredential and remove unused variable Signed-off-by: Karim Stekelenburg <karim@animo.id>
Signed-off-by: Karim Stekelenburg <karim@animo.id>
feat(openid4vc-client.e2e.test.ts): replace requestCredential with requestCredentialUsingPreAuthorizedCode and requestCredentialUsingAuthorizationCode methods Signed-off-by: Karim Stekelenburg <karim@animo.id>
fix(vc): make verifyRevocationState optional in VerifyCredentialOptions feat(vc): set verifyRevocationState to true by default in W3cCredentialService Signed-off-by: Karim Stekelenburg <karim@animo.id>
Removed method to generate codeVerifier from the API. Signed-off-by: Karim Stekelenburg <karim@animo.id>
2976bd9
to
24003e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some final nits for consistency, but LGTM!!
Signed-off-by: Karim Stekelenburg <karim@animo.id>
Nice !! |
This PR contains the logic for the OpenID For Verifiable Credentials Issuance authorization flow.
Funded by the Ontario Government