Skip to content
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

Feature/enable authorization code flow helpers #70

Conversation

linasi
Copy link

@linasi linasi commented Oct 6, 2023

  • Removes checks so library could as well help with authorization code flow.
  • Removed flowType parameter OpenID4VCIClient.
  • Updated acquirePushedAuthorizationRequestURI method to return a complete authorization URL that can be opened by the client. Just like createAuthorizationRequestUrl does.
  • Use clientId that was passed when constructing OpenID4VCIClient in subsequent calls.

@nklomp
Copy link
Contributor

nklomp commented Oct 6, 2023

Cool thanks. will have a look later today or probably tomorrow

Copy link
Contributor

@nklomp nklomp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look over some of the initial comments I made later this weekend.

Overall looks great.

packages/client/lib/OpenID4VCIClient.ts Outdated Show resolved Hide resolved

return convertJsonToURI(queryObj, {
baseUrl: this._endpointMetadata.authorization_endpoint,
uriTypeProperties: ['redirect_uri', 'scope', 'authorization_details'],
version: this.version(),
uriTypeProperties: ['redirect_uri', 'scope', 'authorization_details', 'issuer_state'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will look later into whether leaving the version out doesn't have any side effects

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the current convertJsonToURI implementation, excluding version param will do exactly what is needed in this case. Provided attributes have be added as query params. else statement does exactly that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the problem however is that the convertJsonToURI is called from many places and it for sure needs the logic to distinguish between V11 and higher in other areas. What I will do is add an additional param that takes precedence over the version. From the first look of it you need it from the formPost method. So will use that param there

packages/client/lib/OpenID4VCIClient.ts Outdated Show resolved Hide resolved
@linasi
Copy link
Author

linasi commented Oct 13, 2023

Hi @nklomp, just wanted to let you know that parts you commented on have been addressed. Let me know if there is anything else that you find concerning.

nklomp added a commit that referenced this pull request Oct 14, 2023
…n, not only depending on versions, but also allowing to provide the mode explicitly. refs #70
@nklomp nklomp merged commit a73afee into Sphereon-Opensource:develop Oct 14, 2023
1 check failed
@nklomp
Copy link
Contributor

nklomp commented Oct 14, 2023

@linasi Thanks for the PR. It is merged with a new param to make the encoding a bit more explicit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants