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: ignore non-existent resource scopes during refresh #1222

Merged
merged 4 commits into from
May 30, 2023

Conversation

simeng-li
Copy link
Contributor

@simeng-li simeng-li commented May 25, 2023

Context

We have implemented the RBAC feature in our system based on the oidc-provider. Leveraging resourceIndicators.getResourceServerInfo method to guard and filter the resource scopes being issued.

What problem I have met

After a user is initially sign-in and authenticated, we manually revoke a role(resource scopes) from that user. Or delete the scopes directly from that resource indicator.

Expected behavior

The revoked resource scopes should be filtered from the newly exchanged access tokens.
As mentioned in the doc:
image

Actually behavior

Instead of reading the latest scopes returned from the resource server, the Provider uses the initially granted resource scopes pool to issue new access tokens. The scope can only be revoked till the user re-authenticates.

Summary

Any 'down-scope' action should take effect immediately to the end user. Attempt to filter out revoked or invalid resource scopes using the latest resource server info data in the refresh_token grant action.

Please let me know if there are any other recommended approaches. Thx.

simeng-li and others added 2 commits May 25, 2023 10:44
should prevent any revoked resource scopes being issued to the new access token
@panva panva changed the title fix: filter revoked resouce scopes from access token fix: ignore non-existent resource scopes during refresh May 25, 2023
@panva panva merged commit bdf23ba into panva:main May 30, 2023
@panva
Copy link
Owner

panva commented May 30, 2023

Nice catch, thank you @simeng-li

@simeng-li simeng-li deleted the simeng-filter-revoked-resource-scopes branch May 31, 2023 05:45
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants