Cheetah
|
Public Member Functions | |
__construct (AccessTokenInterface $accessToken, ClientInterface $clientStorage, array $grantTypes=array(), ClientAssertionTypeInterface $clientAssertionType=null, ScopeInterface $scopeUtil=null) | |
handleTokenRequest (RequestInterface $request, ResponseInterface $response) | |
grantAccessToken (RequestInterface $request, ResponseInterface $response) | |
addGrantType (GrantTypeInterface $grantType, $identifier=null) | |
handleRevokeRequest (RequestInterface $request, ResponseInterface $response) | |
revokeToken (RequestInterface $request, ResponseInterface $response) | |
Protected Attributes | |
$accessToken | |
$grantTypes | |
$clientAssertionType | |
$scopeUtil | |
$clientStorage | |
Definition at line 17 of file TokenController.php.
OAuth2\Controller\TokenController::__construct | ( | AccessTokenInterface | $accessToken, |
ClientInterface | $clientStorage, | ||
array | $grantTypes = array() , |
||
ClientAssertionTypeInterface | $clientAssertionType = null , |
||
ScopeInterface | $scopeUtil = null |
||
) |
Definition at line 25 of file TokenController.php.
OAuth2\Controller\TokenController::addGrantType | ( | GrantTypeInterface | $grantType, |
$identifier = null |
|||
) |
addGrantType
grantType | - OAuth2\GrantTypeInterface the grant type to add for the specified identifier |
identifier | - string a string passed in as "grant_type" in the response that will call this grantType |
Definition at line 212 of file TokenController.php.
OAuth2\Controller\TokenController::grantAccessToken | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
Grant or deny a requested access token. This would be called from the "/token" endpoint as defined in the spec. You can call your endpoint whatever you want.
$request | - RequestInterface Request object to grant access token |
InvalidArgumentException | |
LogicException |
Determine grant type from request and validate the request for that grant type
Retrieve the client information from the request ClientAssertionTypes allow for grant types which also assert the client data in which case ClientAssertion is handled in the validateRequest method
Retrieve the grant type information from the request The GrantTypeInterface object handles all validation If the object is an instance of ClientAssertionTypeInterface, That logic is handled here as well
Validate the client can use the requested grant type
Validate the scope of the token
requestedScope - the scope specified in the token request availableScope - the scope associated with the grant type ex: in the case of the "Authorization Code" grant type, the scope is specified in the authorize request
Implements OAuth2\Controller\TokenControllerInterface.
Definition at line 75 of file TokenController.php.
OAuth2\Controller\TokenController::handleRevokeRequest | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
Definition at line 221 of file TokenController.php.
OAuth2\Controller\TokenController::handleTokenRequest | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
handleTokenRequest
$request | OAuth2\RequestInterface - The current http request |
$response | OAuth2\ResponseInterface - An instance of OAuth2\ResponseInterface to contain the response data |
Implements OAuth2\Controller\TokenControllerInterface.
Definition at line 47 of file TokenController.php.
OAuth2\Controller\TokenController::revokeToken | ( | RequestInterface | $request, |
ResponseInterface | $response | ||
) |
Revoke a refresh or access token. Returns true on success and when tokens are invalid
Note: invalid tokens do not cause an error response since the client cannot handle such an error in a reasonable way. Moreover, the purpose of the revocation request, invalidating the particular token, is already achieved.
RequestInterface | $request | |
ResponseInterface | $response |
Definition at line 241 of file TokenController.php.
|
protected |
Definition at line 19 of file TokenController.php.
|
protected |
Definition at line 21 of file TokenController.php.
|
protected |
Definition at line 23 of file TokenController.php.
|
protected |
Definition at line 20 of file TokenController.php.
|
protected |
Definition at line 22 of file TokenController.php.