Make the offline_access scope of the entry point optional - #67
Merged
Merged
Conversation
The scope offline_access is not always necessary or useful.
The entry point requests "offline_access" by default, so that an expired identity token can be refreshed. The new entry point option "requestRefreshToken" turns this off. Not every identity provider handles this scope the same way. Auth0 and Microsoft Entra ID need it to issue a refresh token. Google rejects it with an "invalid_scope" error, so a login with Google failed completely. Keycloak issues an offline token which does not expire with the SSO session. Removing the scope for everyone would silently disable token refresh for all installations which rely on it. The default therefore stays as it is. The README example used a "scopes" option which the entry point does not read. It now uses "scope".
Member
|
Thanks for the PR, and sorry for the long wait! Removing entryPointOptions:
serviceName: 'yourService'
requestRefreshToken: falseWith that, only |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67 +/- ##
============================================
+ Coverage 23.64% 23.99% +0.34%
- Complexity 231 235 +4
============================================
Files 10 10
Lines 592 596 +4
============================================
+ Hits 140 143 +3
- Misses 452 453 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The entry point requests the
offline_accessscope by default, so that an expired identity token can be refreshed. The new entry point optionrequestRefreshToken: falseturns this off.Identity providers handle this scope differently. Auth0 and Microsoft Entra ID need it to issue a refresh token. Google rejects it with an
invalid_scopeerror. Keycloak issues an offline token which does not expire with the SSO session. The default stays, so installations which rely on token refresh keep working.Also fixes the README example, which used a
scopesoption the entry point does not read.