MacAuthorizationTrait
Enables `MAC` header authorization for providers.
Tags
Table of Contents
Methods
- getAuthorizationHeaders() : array<string|int, mixed>
- Returns the authorization headers for the 'mac' grant.
- getMacSignature() : string
- Returns the MAC signature for the current request.
- getRandomState() : string
- Returns a new random string to use as the state parameter in an authorization flow.
- getTokenId() : string
- Returns the id of this token for MAC generation.
Methods
getAuthorizationHeaders()
Returns the authorization headers for the 'mac' grant.
protected
getAuthorizationHeaders([AccessTokenInterface|string|null $token = null ]) : array<string|int, mixed>
Parameters
- $token : AccessTokenInterface|string|null = null
-
Either a string or an access token instance
Tags
Return values
array<string|int, mixed>getMacSignature()
Returns the MAC signature for the current request.
protected
abstract getMacSignature(string $id, int $ts, string $nonce) : string
Parameters
- $id : string
- $ts : int
- $nonce : string
Return values
stringgetRandomState()
Returns a new random string to use as the state parameter in an authorization flow.
protected
abstract getRandomState([int $length = 32 ]) : string
Parameters
- $length : int = 32
-
Length of the random string to be generated.
Return values
stringgetTokenId()
Returns the id of this token for MAC generation.
protected
abstract getTokenId(AccessToken $token) : string
Parameters
- $token : AccessToken