AuthorizationController
class AuthorizationController
Traits
Methods
Convert a PSR-7 response to a Symfony response.
Render authorization errors after rollback using the validated interaction context.
Resolve the guard authorizing the current request.
Get the name of the guard authorizing the current request.
Get the approving guard's user provider.
Capture the approving identity and synchronous extension decisions.
Ensure the consent belongs to the current user and provider.
Get the pending interaction selected by a browser decision.
Recheck the client and scopes saved with the consent request.
Create a new controller instance.
Authorize a client to access the user's account.
Resume a browser interaction without accepting replacement protocol parameters.
Continue a pending authorization as the explicitly selected account.
Sign out for an explicit account switch while preserving only this authorization.
Resolve login, account choice and consent for a validated authorization.
Save a new interaction or advance it without extending its lifetime.
Transform the authorization request's scopes into Scope instances.
Determine if the given user has already granted the client access to the scopes.
Approve the authorization request.
Details
in
ConvertsPsrResponses at line 16
Response
convertResponse(ResponseInterface $psrResponse)
Convert a PSR-7 response to a Symfony response.
in
HandlesOAuthErrors at line 25
protected mixed
withErrorHandling(Closure $callback)
Perform the given callback with exception handling.
in
HandlesOAuthErrors at line 42
protected mixed
withAuthorizationErrorHandling(Closure $callback, array $pending, AuthorizationResponse $responses)
Render authorization errors after rollback using the validated interaction context.
in
ResolvesApprovingGuard at line 28
protected StatefulGuard
getApprovingGuard()
Resolve the guard authorizing the current request.
in
ResolvesApprovingGuard at line 39
protected string
getApprovingGuardName()
Get the name of the guard authorizing the current request.
in
ResolvesApprovingGuard at line 47
protected string|null
getApprovingProvider()
Get the approving guard's user provider.
in
ResolvesApprovingGuard at line 59
protected array
authorizationState(Request $request, array $parameters, Authenticatable $user, Client $client, array $scopes, AuthorizationRequestInterface|DeviceCodeEntityInterface $authorization, Dispatcher $events)
Capture the approving identity and synchronous extension decisions.
in
ResolvesApprovingGuard at line 109
protected void
ensureApprovingUser(array $pending)
Ensure the consent belongs to the current user and provider.
in
ResolvesApprovingGuard at line 127
protected array
getPendingAuthorization(Request $request)
Get the pending interaction selected by a browser decision.
in
ResolvesApprovingGuard at line 143
protected Client
getClientForApproval(string $identifier, string $grantType, array $scopes)
Recheck the client and scopes saved with the consent request.
at line 56
__construct(ServerFactory $servers, AuthManager $auth, ClientRepository $clients, Repository $config, AuthorizationRequestResolver $authorizations, PendingAuthorizationRepository $pending, ConsentRepository $consents, AuthorizationFinalizer $finalizer, AuthorizationResponse $responses, Dispatcher $events, PushedAuthorizationRequestRepository $pushed)
Create a new controller instance.
at line 74
Response
store(Request $request)
Turn a cross-site protocol form into a top-level GET without touching its session.
at line 86
Response|AuthorizationViewResponse
authorize(ServerRequestInterface $psrRequest, Request $request, ResponseInterface $psrResponse, AuthorizationViewResponse $viewResponse)
Authorize a client to access the user's account.
at line 132
Response|AuthorizationViewResponse
resume(string $authorization, Request $request, ServerRequestInterface $psrRequest, ResponseInterface $psrResponse, AuthorizationViewResponse $viewResponse)
Resume a browser interaction without accepting replacement protocol parameters.
at line 168
Response
continueAsCurrentAccount(Request $request)
Continue a pending authorization as the explicitly selected account.
at line 186
Response
switchAccount(Request $request)
Sign out for an explicit account switch while preserving only this authorization.
at line 213
protected Response|AuthorizationViewResponse
respondToAuthorization(Request $request, ServerRequestInterface $psrRequest, AuthorizationRequestInterface $authRequest, ResponseInterface $psrResponse, AuthorizationViewResponse $viewResponse, array $pending, string|null $authorization = null)
Resolve login, account choice and consent for a validated authorization.
at line 372
protected string
saveAuthorization(Request $request, string|null $authorization, array $pending)
Save a new interaction or advance it without extending its lifetime.
at line 388
protected array
parseScopes(AuthorizationRequestInterface $authRequest)
Transform the authorization request's scopes into Scope instances.
at line 407
protected bool
hasGrantedScopes(Authenticatable $user, Client $client, array $scopes, array $permissions = [])
Determine if the given user has already granted the client access to the scopes.
This pre-check does not replace the final locked consent check. Customize Consent::covers() for remembered coverage, or Client::skipsAuthorization() for trusted approval without remembered consent.
at line 421
protected Response
approveRequest(AuthorizationRequestInterface $authRequest, ResponseInterface $psrResponse)
Approve the authorization request.
at line 435
protected never
promptForLogin(Request $request)
Prompt the user to login by throwing an AuthenticationException.