AuthorizationCodeInterface.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace OAuth2\OpenID\Storage;
  3. use OAuth2\Storage\AuthorizationCodeInterface as BaseAuthorizationCodeInterface;
  4. /**
  5. * Implement this interface to specify where the OAuth2 Server
  6. * should get/save authorization codes for the "Authorization Code"
  7. * grant type
  8. *
  9. * @author Brent Shaffer <bshafs at gmail dot com>
  10. */
  11. interface AuthorizationCodeInterface extends BaseAuthorizationCodeInterface
  12. {
  13. /**
  14. * Take the provided authorization code values and store them somewhere.
  15. *
  16. * This function should be the storage counterpart to getAuthCode().
  17. *
  18. * If storage fails for some reason, we're not currently checking for
  19. * any sort of success/failure, so you should bail out of the script
  20. * and provide a descriptive fail message.
  21. *
  22. * Required for OAuth2::GRANT_TYPE_AUTH_CODE.
  23. *
  24. * @param $code authorization code to be stored.
  25. * @param $client_id client identifier to be stored.
  26. * @param $user_id user identifier to be stored.
  27. * @param string $redirect_uri redirect URI(s) to be stored in a space-separated string.
  28. * @param int $expires expiration to be stored as a Unix timestamp.
  29. * @param string $scope OPTIONAL scopes to be stored in space-separated string.
  30. * @param string $id_token OPTIONAL the OpenID Connect id_token.
  31. *
  32. * @ingroup oauth2_section_4
  33. */
  34. public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null, $id_token = null);
  35. }