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

Fix samples #1038

Merged
merged 6 commits into from
Jun 12, 2023
Merged

Fix samples #1038

merged 6 commits into from
Jun 12, 2023

Conversation

perguth
Copy link
Contributor

@perguth perguth commented Jun 6, 2023

Closes/fixes --

  • Pass callback URLs to login/logout requests to prevent fatal errors
  • Add client_id to logout request to prevent fatal errors (tested against Keycloak - either "id_token_hint" (already available) or "client_id" (missing till now) are required when using post_logout_redirect_uri)

Checklist

  • This PR makes changes to the public API
    • Update API report (docs/oidc-client-ts.api.md)
  • I have included links for closing relevant issue numbers

@pamapa pamapa added this to the 2.2.5 milestone Jun 8, 2023
@pamapa
Copy link
Member

pamapa commented Jun 8, 2023

The merge request looks good.

Should we add an automatic logic like this in OidcClient.ts (Line 235):

// specify the client Identifier when post_logout_redirect_uri is used but id_token_hint is not
if ( !client_id && post_logout_redirect_uri && !id_token_hint) {
  client_id = this.settings.client_id;
}

const request = new SignoutRequest({
...

@perguth
Copy link
Contributor Author

perguth commented Jun 10, 2023

Got it.

src/OidcClient.test.ts Outdated Show resolved Hide resolved
src/OidcClient.test.ts Outdated Show resolved Hide resolved
src/OidcClient.test.ts Outdated Show resolved Hide resolved
The listeners in line 9-13 are passing in an event object as first parameter. So the previous code worked when using the `followLinks` flow but not the manual one.
@pamapa pamapa merged commit 6d055f8 into authts:main Jun 12, 2023
@perguth perguth deleted the fix-sample branch June 12, 2023 13:18
@pamapa
Copy link
Member

pamapa commented Jun 15, 2023

thanks for contributing

@perguth perguth restored the fix-sample branch June 15, 2023 08:13
perguth added a commit to perguth/oidc-client-ts that referenced this pull request Jun 15, 2023
@pamapa pamapa added the bug Something isn't working label Aug 18, 2023
dbfr3qs pushed a commit to dbfr3qs/oidc-client-ts that referenced this pull request Apr 3, 2024
* pass callback URLs to login/logout requests in samples to prevent fatal errors
* allow client_id to logout request to prevent fatal errors (tested against Keycloak - either "id_token_hint" (already available) or "client_id" (missing till now) are required when using post_logout_redirect_uri)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants