Best practices for handling access tokens and scopes for OAuth2 implementation?

后端 未结 2 1034
说谎
说谎 2021-02-04 08:43

Assume we have an OAuth2 implementation that supports \"read\" and \"write\" scope.

I retrieve an access token \"f482c829\" with \"read\" scope. If I then change my mind

2条回答
  •  误落风尘
    2021-02-04 09:17

    Say one client (mobile) of an application needs read-only access and another client (website) needs to write as well. This would require client to be able to decide the scope of token request and hence provider to store multiple tokens with different scopes.

    However, it is up to you if you want to extend the scope of an existing token. This means you can keep one scope per application. This can also make easy to revoke access of an application by a user.

提交回复
热议问题