src/Tool/MacAuthorizationTrait.php
protected function getAuthorizationHeaders($token = null)
    {
        if ($token === null) {
            return [];
        }

        $ts    = time();
        $id    = $this->getTokenId($token);
        $nonce = $this->getRandomState(16);
        $mac   = $this->getMacSignature($id, $ts, $nonce);

        $parts = [];
        foreach (compact('id', 'ts', 'nonce', 'mac') as $key => $value) {
            $parts[] = sprintf('%s="%s"', $key, $value);
        }

        return ['Authorization' => 'MAC ' . implode(', ', $parts)];
    }
protected function getAuthorizationHeaders($token = null)
    {
        if ($token === null) {
            return [];
        }

        $ts    = time();
        $id    = $this->getTokenId($token);
        $nonce = $this->getRandomState(16);
        $mac   = $this->getMacSignature($id, $ts, $nonce);

        $parts = [];
        foreach (compact('id', 'ts', 'nonce', 'mac') as $key => $value) {
            $parts[] = sprintf('%s="%s"', $key, $value);
        }

        return ['Authorization' => 'MAC ' . implode(', ', $parts)];
    }
protected function getAuthorizationHeaders ( $ token = null ) { if ( $ token === null ) { return [ ] ; } $ ts = time ( ) ; $ id = $ this -> getTokenId ( $ token ) ; $ nonce = $ this -> getRandomState ( 16 ) ; $ mac = $ this -> getMacSignature ( $ id , $ ts , $ nonce ) ; $ parts = [ ] ; foreach ( compact ( 'id' , 'ts' , 'nonce' , 'mac' ) as $ key => $ value ) { $ parts [ ] = sprintf ( '%s="%s"' , $ key , $ value ) ; } return [ 'Authorization' => 'MAC ' . implode ( ', ' , $ parts ) ] ; }
Returns the authorization headers for the 'mac' grant.

@param  AccessTokenInterface|string|null $token Either a string or an access token instance
@return array
@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
Returns the authorization headers for the mac grant .