Documentation

MacAuthorizationTrait

Enables `MAC` header authorization for providers.

Tags
link

Message Authentication Code (MAC) Tokens

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
codeCoverageIgnore
todo

This is currently untested and provided only as an example. If you complete the implementation, please create a pull request for https://github.com/thephpleague/oauth2-client

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
string

getRandomState()

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
string

        
On this page

Search results