final class Controller implements LoggerAwareInterface (View source)

Traits

Trait LoggerAwareTrait A trait used with LoggerAwareInterface

LoggerAwareTrait

Constants

STEP_LOGIN

STEP_AUTHORIZE_CLIENT

STEP_COMPLETE

Properties

private AuthorizationServer $oauthServer
private EntityManagerInterface $entityManager
private ServerRequestInterface $request
private Session $session
private Token $token
private Repository $config
private User $user

Methods

getLoggerChannel()

No description

__construct(AuthorizationServer $oauthServer, EntityManagerInterface $entityManager, ServerRequestInterface $request, Session $session, Token $token, Repository $config, User $user = null)

No description

ResponseInterface
token()

Handle authorization

validateScopesAgainstClient(Client $client, array $scopes)

Returns true if a) all scopes are allowed by the client or b) the scopes passed in the request are included in the allowed list of client scopes

ResponseInterface|Response
authorize()

Route handler that deals with authorization

Response|RedirectResponse
handleLogin(AuthorizationRequest $request)

Handle the login portion of an authorization request This method renders a view for login that handles either email or username based login

Response|RedirectResponse
handleAuthorizeClient(AuthorizationRequest $request)

Handle the scope authorization portion of an authorization request This method renders a view that outputs a list of scopes and asks the user to verify that they want to give the client the access that is being requested.

pruneTokens()

Prune old authentication tokens

pruneResults($results)

Loop over a list of results and prune them

clearTokenBuffer(array $buffer)

Remove items in a buffer from the entity manager

AuthorizationRequest
getAuthorizationRequest()

No description

int
getConsentType(AuthorizationRequest $request)

Get the consent type associated with the current request

storeRequest(AuthorizationRequest $request)

Store a request against session

AuthorizationRequest|null
restoreRequest(array $data)

Restore a real request from the passed data

clearRequest(AuthorizationRequest $request)

Remove all session data related to this flow

object|null
inflateType(int|string|null $identifier, string $type = Scope::class)

Inflate an identifier into a specific type

int
determineStep(AuthorizationRequest $request)

Figure out what step we should be rendering based on the active authorization request This method should handle verifying authorization and login

createLoginView(array $data)

Create a new authorize login view with the given data in scope

Details

getLoggerChannel()

No description

__construct(AuthorizationServer $oauthServer, EntityManagerInterface $entityManager, ServerRequestInterface $request, Session $session, Token $token, Repository $config, User $user = null)

No description

Parameters

AuthorizationServer $oauthServer
EntityManagerInterface $entityManager
ServerRequestInterface $request
Session $session
Token $token
Repository $config
User $user

ResponseInterface token()

Handle authorization

Return Value

ResponseInterface

Exceptions

Exception

protected validateScopesAgainstClient(Client $client, array $scopes)

Returns true if a) all scopes are allowed by the client or b) the scopes passed in the request are included in the allowed list of client scopes

Parameters

Client $client
array $scopes

ResponseInterface|Response authorize()

Route handler that deals with authorization

Return Value

ResponseInterface|Response

Response|RedirectResponse handleLogin(AuthorizationRequest $request)

Handle the login portion of an authorization request This method renders a view for login that handles either email or username based login

Parameters

AuthorizationRequest $request

Return Value

Response|RedirectResponse

Response|RedirectResponse handleAuthorizeClient(AuthorizationRequest $request)

Handle the scope authorization portion of an authorization request This method renders a view that outputs a list of scopes and asks the user to verify that they want to give the client the access that is being requested.

Parameters

AuthorizationRequest $request

Return Value

Response|RedirectResponse

Exceptions

OAuthServerException

private pruneTokens()

Prune old authentication tokens

private pruneResults($results)

Loop over a list of results and prune them

Parameters

$results

private clearTokenBuffer(array $buffer)

Remove items in a buffer from the entity manager

Parameters

array $buffer

private AuthorizationRequest getAuthorizationRequest()

No description

Return Value

AuthorizationRequest

Exceptions

OAuthServerException

private int getConsentType(AuthorizationRequest $request)

Get the consent type associated with the current request

Parameters

AuthorizationRequest $request

Return Value

int

private storeRequest(AuthorizationRequest $request)

Store a request against session

Parameters

AuthorizationRequest $request

private AuthorizationRequest|null restoreRequest(array $data)

Restore a real request from the passed data

Parameters

array $data

Return Value

AuthorizationRequest|null

private clearRequest(AuthorizationRequest $request)

Remove all session data related to this flow

Parameters

AuthorizationRequest $request

private object|null inflateType(int|string|null $identifier, string $type = Scope::class)

Inflate an identifier into a specific type

Parameters

int|string|null $identifier
string $type

Return Value

object|null

The inflated entity

private int determineStep(AuthorizationRequest $request)

Figure out what step we should be rendering based on the active authorization request This method should handle verifying authorization and login

Parameters

AuthorizationRequest $request

Return Value

int

private View createLoginView(array $data)

Create a new authorize login view with the given data in scope

Parameters

array $data

Return Value

View

Exceptions

OAuthServerException