Why Does OAuth v2 Have Both Access and Refresh Tokens?

后端 未结 14 2646
情话喂你
情话喂你 2020-11-22 12:36

Section 4.2 of the draft OAuth 2.0 protocol indicates that an authorization server can return both an access_token (which is used to authenticate oneself with a

14条回答
  •  佛祖请我去吃肉
    2020-11-22 13:17

    First, the client authenticates with the authorization server by giving the authorization grant.

    Then, the client requests the resource server for the protected resource by giving the access token.

    The resource server validates the access token and provides the protected resource.

    The client makes the protected resource request to the resource server by granting the access token, where the resource server validates it and serves the request, if valid. This step keeps on repeating until the access token expires.

    If the access token expires, the client authenticates with the authorization server and requests for a new access token by providing refresh token. If the access token is invalid, the resource server sends back the invalid token error response to the client.

    The client authenticates with the authorization server by granting the refresh token.

    The authorization server then validates the refresh token by authenticating the client and issues a new access token, if it is valid.

提交回复
热议问题