-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
auth-node: refactor OAuth scope management #24743
base: master
Are you sure you want to change the base?
Conversation
Changed Packages
|
@@ -68,7 +66,7 @@ describe('authModuleOktaProvider', () => { | |||
expect(startUrl.pathname).toBe('/oauth2/v1/authorize'); | |||
expect(Object.fromEntries(startUrl.searchParams)).toEqual({ | |||
response_type: 'code', | |||
scope: combinedScopes, | |||
scope: additionalScopes, |
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.
The behavior change here just highlights that passing scope
to the strategy is broken and currently breaks in the same way if any scopes requested from the client. Followup fix will reintroduce the default scopes that we lose if we configure additional scopes here.
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.
Lookin' awesome
This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution! |
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Hey, I just made a Pull Request!
This standardizes scope management across OAuth providers, and also aims to fix a couple of issues, especially providers that persist scopes. The overall goal of this is to be able to completely remove the need for bespoke auth APIs in the frontend, in particular for sign-in.
One issue that's been fixed is refreshing with scope persistence. In the current implementation the persisted scopes will always be used, which can break this client flow where a session is refreshed with requested scopes.
An issue that I'll be aiming to fix in followup usages of this is that many auth providers pass the
scope
option to the passport strategy. That only works if no scopes are requested by the client, because they are not merged. This aims to fix that by properly merging together required, additional, requested and granted scopes.Will do updates for each provider in followups, so that we can get some eyes/testing of each individual update.
✔️ Checklist
Signed-off-by
line in the message. (more info)