class ApproveAuthorizationController

Traits

Methods

Response
convertResponse(ResponseInterface $psrResponse)

Convert a PSR-7 response to a Symfony response.

mixed
withErrorHandling(Closure $callback)

Perform the given callback with exception handling.

mixed
withAuthorizationErrorHandling(Closure $callback, array $pending, AuthorizationResponse $responses)

Render authorization errors after rollback using the validated interaction context.

AuthorizationRequestInterface
getAuthRequestFromSession(Request $request)

Get the authorization request from the session.

getApprovingGuard()

Resolve the guard authorizing the current request.

string
getApprovingGuardName()

Get the name of the guard authorizing the current request.

string|null
getApprovingProvider()

Get the approving guard's user provider.

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.

void
ensureApprovingUser(array $pending)

Ensure the consent belongs to the current user and provider.

array
getPendingAuthorization(Request $request)

Get the pending interaction selected by a browser decision.

getClientForApproval(string $identifier, string $grantType, array $scopes)

Recheck the client and scopes saved with the consent request.

__construct(ServerFactory $servers, AuthManager $auth, Repository $config, ClientRepository $clients, PendingAuthorizationRepository $pending, AuthorizationRequestResolver $authorizations, AuthorizationFinalizer $finalizer, AuthorizationResponse $responses)

Create a new controller instance.

Response
approve(Request $request, ResponseInterface $psrResponse)

Approve the authorization request.

Details

Response convertResponse(ResponseInterface $psrResponse)

Convert a PSR-7 response to a Symfony response.

Parameters

ResponseInterface $psrResponse

Return Value

Response

in HandlesOAuthErrors at line 25
protected mixed withErrorHandling(Closure $callback)

Perform the given callback with exception handling.

Parameters

Closure $callback

Return Value

mixed

Exceptions

OAuthServerException

in HandlesOAuthErrors at line 42
protected mixed withAuthorizationErrorHandling(Closure $callback, array $pending, AuthorizationResponse $responses)

Render authorization errors after rollback using the validated interaction context.

Parameters

Closure $callback
array $pending
AuthorizationResponse $responses

Return Value

mixed

protected AuthorizationRequestInterface getAuthRequestFromSession(Request $request)

Get the authorization request from the session.

Parameters

Request $request

Return Value

AuthorizationRequestInterface

Exceptions

InvalidAuthTokenException
Exception

protected StatefulGuard getApprovingGuard()

Resolve the guard authorizing the current request.

Return Value

StatefulGuard

protected string getApprovingGuardName()

Get the name of the guard authorizing the current request.

Return Value

string

protected string|null getApprovingProvider()

Get the approving guard's user provider.

Return Value

string|null

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.

Parameters

Request $request
array $parameters
Authenticatable $user
Client $client
array $scopes
AuthorizationRequestInterface|DeviceCodeEntityInterface $authorization
Dispatcher $events

Return Value

array

protected void ensureApprovingUser(array $pending)

Ensure the consent belongs to the current user and provider.

Parameters

array $pending

Return Value

void

protected array getPendingAuthorization(Request $request)

Get the pending interaction selected by a browser decision.

Parameters

Request $request

Return Value

array

protected Client getClientForApproval(string $identifier, string $grantType, array $scopes)

Recheck the client and scopes saved with the consent request.

Parameters

string $identifier
string $grantType
array $scopes

Return Value

Client

at line 30
__construct(ServerFactory $servers, AuthManager $auth, Repository $config, ClientRepository $clients, PendingAuthorizationRepository $pending, AuthorizationRequestResolver $authorizations, AuthorizationFinalizer $finalizer, AuthorizationResponse $responses)

Create a new controller instance.

at line 45
Response approve(Request $request, ResponseInterface $psrResponse)

Approve the authorization request.

Parameters

Request $request
ResponseInterface $psrResponse

Return Value

Response