Skip to content

Add prompt=consent for OIDC offline_access scope #681

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dankelleher
Copy link

<!-- 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? -->

  • Added unit test to verify prompt=consent is added when scope includes offline_access
  • Verified existing authorization flows without offline_access are unaffected
  • All existing tests pass

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: -->

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

<!-- Go over all the following points, and put an x in all the boxes that apply. -->

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant