Documentation

AbstractGrant
in package
uses RequiredParameterTrait

AbstractYes

Represents a type of authorization grant.

An authorization grant is a credential representing the resource owner's authorization (to access its protected resources) used by the client to obtain an access token. OAuth 2.0 defines four grant types -- authorization code, implicit, resource owner password credentials, and client credentials -- as well as an extensibility mechanism for defining additional types.

Tags
link

Authorization Grant (RFC 6749, §1.3)

Table of Contents

Methods

__toString()  : string
Returns this grant's name as its string representation. This allows for string interpolation when building URL query parameters.
prepareRequestParameters()  : array<string|int, mixed>
Prepares an access token request's parameters by checking that all required parameters are set, then merging with any given defaults.
getName()  : string
Returns the name of this grant, eg. 'grant_name', which is used as the grant type when encoding URL query parameters.
getRequiredRequestParameters()  : array<string|int, mixed>
Returns a list of all required request parameters.
checkRequiredParameter()  : void
Checks for a required parameter in a hash.
checkRequiredParameters()  : void
Checks for multiple required parameters in a hash.

Methods

__toString()

Returns this grant's name as its string representation. This allows for string interpolation when building URL query parameters.

public __toString() : string
Return values
string

prepareRequestParameters()

Prepares an access token request's parameters by checking that all required parameters are set, then merging with any given defaults.

public prepareRequestParameters(array<string|int, mixed> $defaults, array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$defaults : array<string|int, mixed>
$options : array<string|int, mixed>
Return values
array<string|int, mixed>

getName()

Returns the name of this grant, eg. 'grant_name', which is used as the grant type when encoding URL query parameters.

protected abstract getName() : string
Return values
string

getRequiredRequestParameters()

Returns a list of all required request parameters.

protected abstract getRequiredRequestParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

checkRequiredParameter()

Checks for a required parameter in a hash.

private checkRequiredParameter(string $name, array<string|int, mixed> $params) : void
Parameters
$name : string
$params : array<string|int, mixed>
Tags
throws
BadMethodCallException

checkRequiredParameters()

Checks for multiple required parameters in a hash.

private checkRequiredParameters(array<string|int, mixed> $names, array<string|int, mixed> $params) : void
Parameters
$names : array<string|int, mixed>
$params : array<string|int, mixed>
Tags
throws
InvalidArgumentException

        
On this page

Search results