BearerTokenResponse.php 678 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Auth;
  3. use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
  4. class BearerTokenResponse extends \League\OAuth2\Server\ResponseTypes\BearerTokenResponse
  5. {
  6. /**
  7. * Add custom fields to your Bearer Token response here, then override
  8. * AuthorizationServer::getResponseType() to pull in your version of
  9. * this class rather than the default.
  10. *
  11. * @param AccessTokenEntityInterface $accessToken
  12. *
  13. * @return array
  14. */
  15. protected function getExtraParams(AccessTokenEntityInterface $accessToken)
  16. {
  17. return [
  18. 'created_at' => time(),
  19. 'scope' => 'read write follow push'
  20. ];
  21. }
  22. }