\OAuth2\GrantTypeClientCredentials

Validate a client via Http Basic authentication

Summary

Methods
Properties
Constants
__construct()
validateRequest()
getClientId()
getClientCredentials()
getQueryStringIdentifier()
getScope()
getUserId()
createAccessToken()
No public properties found
No constants found
No protected methods found
$storage
$config
N/A
loadClientData()
$clientData
N/A

Properties

$storage

$storage : 

Type

$config

$config : 

Type

$clientData

$clientData : array

Type

array

Methods

__construct()

__construct(\OAuth2\Storage\ClientCredentialsInterface  $storage, array  $config = array()) 

Config array $config should look as follows:

Parameters

\OAuth2\Storage\ClientCredentialsInterface $storage

Storage

array $config

Configuration options for the server

validateRequest()

validateRequest(\OAuth2\RequestInterface  $request, \OAuth2\ResponseInterface  $response) : boolean|mixed

Validate the OAuth request

Parameters

\OAuth2\RequestInterface $request
\OAuth2\ResponseInterface $response

Throws

\LogicException

Returns

boolean|mixed

getClientId()

getClientId() : mixed

Get the client id

Returns

mixed

getClientCredentials()

getClientCredentials(\OAuth2\RequestInterface  $request, \OAuth2\ResponseInterface  $response = null) : array|null

Internal function used to get the client credentials from HTTP basic auth or POST data.

According to the spec (draft 20), the client_id can be provided in the Basic Authorization header (recommended) or via GET/POST.

Parameters

\OAuth2\RequestInterface $request
\OAuth2\ResponseInterface $response

Returns

array|null —

A list containing the client identifier and password, for example:

getQueryStringIdentifier()

getQueryStringIdentifier() : string

Get query string identifier

Returns

string

getScope()

getScope() : string|null

Get scope

Returns

string|null

getUserId()

getUserId() : mixed

Get user id

Returns

mixed

createAccessToken()

createAccessToken(\OAuth2\ResponseType\AccessTokenInterface  $accessToken, mixed  $client_id, mixed  $user_id, string  $scope) : array

Create access token

Parameters

\OAuth2\ResponseType\AccessTokenInterface $accessToken
mixed $client_id
  • client identifier related to the access token.
mixed $user_id
  • user id associated with the access token
string $scope
  • scopes to be stored in space-separated string.

Returns

array

loadClientData()

loadClientData()