AccessTokenInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace OAuth2\ResponseType;
  3. /**
  4. * @author Brent Shaffer <bshafs at gmail dot com>
  5. */
  6. interface AccessTokenInterface extends ResponseTypeInterface
  7. {
  8. /**
  9. * Handle the creation of access token, also issue refresh token if supported / desirable.
  10. *
  11. * @param mixed $client_id - client identifier related to the access token.
  12. * @param mixed $user_id - user ID associated with the access token
  13. * @param string $scope - OPTONAL scopes to be stored in space-separated string.
  14. * @param bool $includeRefreshToken - if true, a new refresh_token will be added to the response
  15. *
  16. * @see http://tools.ietf.org/html/rfc6749#section-5
  17. * @ingroup oauth2_section_5
  18. */
  19. public function createAccessToken($client_id, $user_id, $scope = null, $includeRefreshToken = true);
  20. /**
  21. * Handle the revoking of refresh tokens, and access tokens if supported / desirable
  22. *
  23. * @param $token
  24. * @param $tokenTypeHint
  25. * @return mixed
  26. *
  27. * @todo v2.0 include this method in interface. Omitted to maintain BC in v1.x
  28. */
  29. //public function revokeToken($token, $tokenTypeHint);
  30. }