Class AbstractProvider
Represents a service provider (authorization server).
- League\OAuth2\Client\Provider\AbstractProvider uses League\OAuth2\Client\Tool\ArrayAccessorTrait, League\OAuth2\Client\Tool\QueryBuilderTrait
Direct known subclasses
Docta\MercadoLibre\OAuth2\Client\Provider, League\OAuth2\Client\Provider\GenericProviderNamespace: League\OAuth2\Client\Provider
Link: Roles (RFC 6749, ยง1.1)
Located at src/Provider/AbstractProvider.php
public
|
#
__construct( array $options = [], array $collaborators = [] )
Constructs an OAuth 2.0 service provider. |
protected
array
|
#
getAllowedClientOptions( array $options )
Returns the list of options that can be passed to the HttpClient |
public
|
#
setGrantFactory(
Sets the grant factory instance. |
public
|
|
public
|
#
setRequestFactory(
Sets the request factory instance. |
public
|
|
public
|
|
public
|
|
public
string
|
|
abstract public
string
|
|
abstract public
string
|
|
abstract public
string
|
#
getResourceOwnerDetailsUrl(
Returns the URL for requesting the resource owner's details. |
protected
string
|
#
getRandomState( integer $length = 32 )
Returns a new random string to use as the state parameter in an authorization flow. |
abstract protected
array
|
|
protected
string
|
#
getScopeSeparator( )
Returns the string that should be used to separate scopes when building the URL for requesting an access token. |
protected
array
|
#
getAuthorizationParameters( array $options )
Returns authorization parameters based on provided options. |
protected
string
|
|
public
string
|
|
public
mixed
|
|
protected
string
|
|
protected
string
|
|
protected
string|null
|
#
getAccessTokenResourceOwnerId( )
Returns the key used in the access token response to identify the resource owner. |
protected
string
|
|
protected
|
#
verifyGrant(
Checks that a provided grant is valid, or attempts to produce one if the provided grant is a string. |
protected
string
|
|
protected
string
|
|
protected
array
|
#
getAccessTokenOptions( array $params )
Builds request options used for requesting an access token. |
protected
|
|
public
|
#
getAccessToken( mixed $grant, array $options = [] )
Requests an access token using a specified grant and option set. |
public
|
#
getRequest( string $method, string $url, array $options = [] )
Returns a PSR-7 request instance that is not authenticated. |
public
|
#
getAuthenticatedRequest( string $method, string $url,
Returns an authenticated PSR-7 request instance. |
protected
|
#
createRequest( string $method, string $url,
Creates a PSR-7 request instance. |
public
|
#
getResponse(
Sends a request instance and returns a response instance. |
public
mixed
|
#
getParsedResponse(
Sends a request and returns the parsed response. |
protected
array
|
|
protected
string
|
#
getContentType(
Returns the content type header of a response. |
protected
array
|
#
parseResponse(
Parses the response according to its content-type header. |
abstract protected
|
#
checkResponse(
Checks a provider response for errors. |
protected
array
|
|
protected
|
#
createAccessToken( array $response,
Creates an access token from a response. |
abstract protected
|
#
createResourceOwner( array $response,
Generates a resource owner object from a successful resource owner details request. |
public
|
#
getResourceOwner(
Requests and returns the resource owner of given access token. |
protected
mixed
|
#
fetchResourceOwnerDetails(
Requests resource owner details. |
protected
array
|
|
protected
array
|
#
getAuthorizationHeaders( mixed|null $token = null )
Returns the authorization headers used by this provider. |
public
array
|
buildQueryString()
|
string |
ACCESS_TOKEN_RESOURCE_OWNER_ID
|
#
null
|
string |
METHOD_GET
|
#
'GET'
|
string |
METHOD_POST
|
#
'POST'
|
protected
string
|
$clientId
|
|
protected
string
|
$clientSecret
|
|
protected
string
|
$redirectUri
|
|
protected
string
|
$state
|
|
protected
|
$grantFactory
|
|
protected
|
$requestFactory
|
|
protected
|
$httpClient
|