Combining OpenId and OfflineAccess scope #16220
Open
+9
−1
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.
When the client scope is set to "openid offline_access", the returned scope only has the "offline_access" scope. The "openid" scope and the "id_token" are missing. By combining the OpenId and OfflineAccess as return scope, the refresh_token and id_token are returned.
Prerequisites
If there's an existing issue for this PR then this fixes
Description
This change checks if the OpenId and/or OfflineAccess scope is set and combines them.
To test I've used the Client app of this repro from Jeroen Breuer: https://github.com/jbreuer/UmbracoDeliveryApiAuthDemo
Change https://github.com/jbreuer/UmbracoDeliveryApiAuthDemo/blob/a799b307302f7189d7ddd69b9554ae2b24612eb4/src/Client/src/App.js#L22 to
const scope = 'openid offline_access';
Copy the "OpenIdConnect" section in the appsettings.json to your own installation.
Note that the id_token is missing and the scope is set to "offline_access" only.
After applying this PR, te result looks like this: