-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Description
The current ScopeRepositoryInterface does not expose any context about the OAuth2 grant/flow (e.g., authorization_code, client_credentials, refresh_token) when resolving or validating scopes.
namespace League\OAuth2\Server\Repositories;
interface ScopeRepositoryInterface extends RepositoryInterface
{
public function getScopeEntityByIdentifier($identifier);
}
This makes it impossible to:
- Restrict or validate scopes per flow
- Return different scope entities depending on the flow
Suggestion
It could be beneficial to extend getScopeEntityByIdentifier() to accept additional context parameters, such as:
$grantType
or$flow
: (e.g. "client_credentials", "authorization_code")- Optionally, client or user context (if applicable)
This enhancement would enable more granular and secure scope validation.
Example Issue
In Client Credentials Flow, there is no end-user authentication - only the client itself is authenticated.
For security and compliance reasons, the openid
scope must not be allowed in this flow. However, with the current interface, it’s not possible to reject openid
only for client_credentials.
Metadata
Metadata
Assignees
Labels
No labels