Add prompt=consent for OIDC offline_access scope #681
+21
−0
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.
<!-- Provide a brief summary of your changes -->
Add automatic prompt=consent parameter when requesting offline_access scope in OpenID Connect flows. This ensures proper user consent for refresh token issuance as required by the OIDC specification.
Motivation and Context
<!-- Why is this change needed? What problem does it solve? -->
OpenID Connect specification requires that when requesting the "offline_access" scope (which grants refresh tokens), the authorization server must ensure the user explicitly consents to this access. By adding prompt=consent when offline_access is requested, we ensure OIDC-compliant authorization servers properly prompt users for consent.
Reference: https://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess
How Has This Been Tested?
<!-- Have you tested this in a real application? Which scenarios were tested? -->
Breaking Changes
<!-- Will users need to update their code or configurations? -->
No breaking changes. This only affects flows that request the offline_access scope, and ensures they comply with OIDC requirements.
Types of changes
<!-- What types of changes does your code introduce? Put an
x
in all the boxes that apply: -->Checklist
<!-- Go over all the following points, and put an
x
in all the boxes that apply. -->Additional context
<!-- Add any other context, implementation notes, or design decisions -->
This change specifically checks if the requested scope includes "offline_access" and appends prompt=consent to the authorization URL. This is a minimal change that improves OIDC compliance without affecting existing OAuth 2.0 flows.