AuthorizeController
- Full name:
\OAuth2\Controller\AuthorizeController
- This class implements:
\OAuth2\Controller\AuthorizeControllerInterface
See Also:
- \OAuth2\Controller\AuthorizeControllerInterface -
Properties
scope
state
client_id
redirect_uri
response_type
The response type
clientStorage
responseTypes
config
scopeUtil
Methods
__construct
Constructor
public __construct(\OAuth2\Storage\ClientInterface $clientStorage, array $responseTypes = array(), array $config = array(), \OAuth2\ScopeInterface $scopeUtil = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$clientStorage |
\OAuth2\Storage\ClientInterface | REQUIRED Instance of OAuth2\Storage\ClientInterface to retrieve client information |
$responseTypes |
array | OPTIONAL Array of OAuth2\ResponseType\ResponseTypeInterface objects. Valid array keys are "code" and "token" |
$config |
array | OPTIONAL Configuration options for the server: |
$scopeUtil |
\OAuth2\ScopeInterface | OPTIONAL Instance of OAuth2\ScopeInterface to validate the requested scope |
handleAuthorizeRequest
Handle the authorization request
public handleAuthorizeRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response, bool $is_authorized, mixed $user_id = null): mixed|void
Parameters:
Parameter | Type | Description |
---|---|---|
$request |
\OAuth2\RequestInterface | |
$response |
\OAuth2\ResponseInterface | |
$is_authorized |
bool | |
$user_id |
mixed |
Throws:
setNotAuthorizedResponse
Set not authorized response
protected setNotAuthorizedResponse(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response, string $redirect_uri, mixed $user_id = null): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$request |
\OAuth2\RequestInterface | |
$response |
\OAuth2\ResponseInterface | |
$redirect_uri |
string | |
$user_id |
mixed |
buildAuthorizeParameters
We have made this protected so this class can be extended to add/modify these parameters
protected buildAuthorizeParameters(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response, mixed $user_id): array
Parameters:
Parameter | Type | Description |
---|---|---|
$request |
\OAuth2\RequestInterface | |
$response |
\OAuth2\ResponseInterface | |
$user_id |
mixed |
validateAuthorizeRequest
Validate the OAuth request
public validateAuthorizeRequest(\OAuth2\RequestInterface $request, \OAuth2\ResponseInterface $response): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$request |
\OAuth2\RequestInterface | |
$response |
\OAuth2\ResponseInterface |
buildUri
Build the absolute URI based on supplied URI and parameters.
Parameters:
Parameter | Type | Description |
---|---|---|
$uri |
string | An absolute URI. |
$params |
array | Parameters to be append as GET. |
Return Value:
An absolute URI with supplied parameters.
getValidResponseTypes
validateRedirectUri
Internal method for validating redirect URI supplied
Parameters:
Parameter | Type | Description |
---|---|---|
$inputUri |
string | The submitted URI to be validated |
$registeredUriString |
string | The allowed URI(s) to validate against. Can be a space-delimited string of URIs to allow for multiple URIs |
See Also:
- http://tools.ietf.org/html/rfc6749#section-3.1.2 -
getScope
Convenience method to access the scope
getState
Convenience method to access the state
getClientId
Convenience method to access the client id
getRedirectUri
Convenience method to access the redirect url
getResponseType
Convenience method to access the response type
Automatically generated on 2025-03-18