diff --git a/public/source/index.php b/public/source/index.php index 8b33163..42bd8d1 100644 --- a/public/source/index.php +++ b/public/source/index.php @@ -531,7 +531,17 @@
The specifics of how the token endpoint verifies the authorization code are out of scope of this document, as typically the authorization endpoint and token endpoint are part of the same system and can share storage or another private communication mechanism.
-If the request is valid, then the token endpoint can generate an access token and return the appropriate response. The token response is a JSON [[!RFC7159]] object containing the OAuth 2.0 Bearer Token [[!RFC6750]], as well as a property me
, containing the canonical user profile URL for the user this access token corresponds to, and, if the profile
scope was requested, the property profile
with the user's profile information as defined in Profile Information. For example:
If the request is valid, then the token endpoint can generate an access token and return the appropriate response. The token response is a JSON [[!RFC7159]] object containing:
+ +access_token
(required) - the OAuth 2.0 Bearer Token [[!RFC6750]].me
(required) - the canonical user profile URL for the user this access token corresponds to.profile
(optional) - the user's profile information as defined in Profile Information.expires_in
(recommended) - The lifetime in seconds of the access token.refresh_token
(optional) - The refresh token, which can be used to obtain new access tokens as defined in Refresh Tokens.For example:
HTTP/1.1 200 OK Content-Type: application/json @@ -679,6 +689,43 @@ ++ Refresh Tokens
+ +Refresh tokens are issued to the client by the authorization server and MAY be used at any time to obtain a new access token, usually when the current access token becomes invalid or expires, or to obtain a new token with identical or narrower scope (access tokens may have a shorter lifetime and fewer permissions than authorized by the resource owner).
+ +Use of short-lived access tokens and the offering of refresh tokens is RECOMMENDED, however, issuing a refresh token is at the discretion of the authorization server, and may be issued based on properties of the client, properties of the request, policies within the authorization server, a choice by the user authorizing the request or any other criteria. If the authorization server issues a refresh token, it is included in the return when issuing an access token. If the authorization server decides not to issue refresh tokens, or the refresh token expires, the client MAY obtain new access tokens by starting the authorization flow over.
+ +Authorization servers MAY revoke refresh tokens automatically in case of a security event, such as a password change or a logout at the authorization server, or when they are redeemed, in which case a new refresh token MAY be provided. Refresh tokens SHOULD expire if the client has been inactive for some time, i.e., the refresh token has not been used to obtain fresh access tokens for some time. The expiration time is at the discretion of the authorization server.
+ ++ +Refreshing an Access Token
+ +To refresh an access token, the client makes a POST request to the token endpoint to exchange the refresh token for the new access token. The POST request contains the following parameters:
+ ++
+ +- +
grant_type=refresh_token
- +
refresh_token
- The refresh token previously offered to the client.client_id
- The client ID that was used when the refresh token was issued. +- +
scope
(optional) - The client may request a token with the same or fewer scopes than the original access token. If omitted, is treated as equal to the original scopes granted.For example:
+ += htmlspecialchars( +'POST https://example.org/token +Content-type: application/x-www-form-urlencoded +Accept: application/json + +grant_type=refresh_token +&refresh_token=xxxxxxxx&client_id=https://app.example.com +') ?>+ +If valid and authorized, the authorization server issues an access token as noted in Access Token Response. The authorization server MAY issue a new refresh token, in which case the client MUST discard the old refresh token and replace it with the new refresh token. The authorization server MAY revoke the old refresh token after issuing a new refresh token to the client. If a new refresh token is issued, the refresh token scope MUST be identical to that of the refresh token included by the client in the request.
+Refresh tokens SHOULD expire if the client has been inactive for some time, i.e., the refresh token has not been used to obtain new access tokens for some time. The expiration time is at the discretion of the authorization server.
+ +