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: Use proper scopes in refresh token handler #698

Closed

Commits on Aug 31, 2022

  1. oauth2 flow_refresh: Use granted scope parameters in token refresh

    Fixing the OAuth2 token refresh handler to:
     - Read and use the optional 'scope' form parameter, if present.
     - Otherwise default to requesting the originally granted scopes.
    
    This endpoint should be completely agnostic of:
     - The originally **requested** scopes
     - The **client scopes** (both current and past client scopes)
    
    Fixes ory#696
    silverspace committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    0f25684 View commit details
    Browse the repository at this point in the history
  2. oauth2 flow_refresh_test: Add unit tests for optional 'scope' param

    Updating our OAuth2 token refresh handler tests to completely ignore
    the **Client Scopes** and **Originally Requested Scopes**. Instead,
    the originally granted scopes should be the only scopes validated
    against.
    
    Also adding some tests to validate the optional 'scope' parameter,
    as outlined in https://www.rfc-editor.org/rfc/rfc6749#section-6
    
    Note that this implementation returns an ErrInvalidScope if the
    'scope' form parameter is defined but empty.
    silverspace committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    d9ecd46 View commit details
    Browse the repository at this point in the history