\OAuth2\StorageAuthorizationCodeInterface

Implement this interface to specify where the OAuth2 Server should get/save authorization codes for the "Authorization Code" grant type

Summary

Methods
Constants
getAuthorizationCode()
setAuthorizationCode()
expireAuthorizationCode()
RESPONSE_TYPE_CODE
No protected methods found
N/A
No private methods found
N/A

Constants

RESPONSE_TYPE_CODE

RESPONSE_TYPE_CODE

The Authorization Code grant type supports a response type of "code".

Methods

getAuthorizationCode()

getAuthorizationCode(  $code) : \OAuth2\Storage\An

Fetch authorization code data (probably the most common grant type).

Retrieve the stored data for the given authorization code.

Required for OAuth2::GRANT_TYPE_AUTH_CODE.

Parameters

$code

Authorization code to be check with.

Returns

\OAuth2\Storage\An —

associative array as below, and NULL if the code is invalid

setAuthorizationCode()

setAuthorizationCode(string  $code, mixed  $client_id, mixed  $user_id, string  $redirect_uri, integer  $expires, string  $scope = null) 

Take the provided authorization code values and store them somewhere.

This function should be the storage counterpart to getAuthCode().

If storage fails for some reason, we're not currently checking for any sort of success/failure, so you should bail out of the script and provide a descriptive fail message.

Required for OAuth2::GRANT_TYPE_AUTH_CODE.

Parameters

string $code
  • Authorization code to be stored.
mixed $client_id
  • Client identifier to be stored.
mixed $user_id
  • User identifier to be stored.
string $redirect_uri
  • Redirect URI(s) to be stored in a space-separated string.
integer $expires
  • Expiration to be stored as a Unix timestamp.
string $scope
  • OPTIONAL Scopes to be stored in space-separated string.