Skip to content

Commit

Permalink
Used BearerAuthorizationTrait intstead of getAuthorizationHeaders #2
Browse files Browse the repository at this point in the history
  • Loading branch information
tanigami committed Jun 14, 2017
1 parent 38756ae commit ea8c3a0
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/Provider/BaseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Tool\BearerAuthorizationTrait;
use Psr\Http\Message\ResponseInterface;

class BaseProvider extends AbstractProvider
{
use BearerAuthorizationTrait;

/**
* Returns the base URL for authorizing a client.
*
Expand Down Expand Up @@ -89,17 +92,6 @@ protected function createResourceOwner(array $response, AccessToken $token)
return new BaseResourceOwner($response);
}

/**
* Returns the authorization headers used by this provider.
*
* @param mixed|null $token Either a string or an access token instance
* @return array
*/
public function getAuthorizationHeaders($token = null)
{
return array('Authorization' => 'Bearer '.$token->getToken());
}

/**
* Returns the string that should be used to separate scopes when building
* the URL for requesting an access token.
Expand Down

0 comments on commit ea8c3a0

Please sign in to comment.