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