为什么 OAuth 2.0 中有两种不同的令牌?
Why are there 2 different kinds of tokens in OAuth 2.0?
OAuth 2.0 似乎有两种不同类型的令牌。
1:访问令牌
2:刷新令牌
根据 Google 文档 "API Client Library for Python: Getting Started" ...
When a user grants your application access, the OAuth 2.0
authorization server provides your application with refresh and access
tokens. These tokens are only valid for the scope requested. Your
application uses access tokens to authorize API calls. Access tokens
expire, but refresh tokens do not. Your application can use a refresh
token to acquire a new access token.
从表面上看,这对我来说听起来像是不必要的复杂性。
简单胜于复杂。
为什么我们需要 2?
必须管理 2 的额外复杂性带来了什么好处?
好像这是一个重复的问题。
“刷新令牌的想法是,如果访问令牌被泄露,因为它是短暂的,攻击者可以有限地window滥用它。
刷新令牌如果遭到破坏,将毫无用处,因为除了刷新令牌之外,攻击者还需要客户端 ID 和密码才能获得访问令牌。
Why Does OAuth v2 Have Both Access and Refresh Tokens?
OAuth 2.0 似乎有两种不同类型的令牌。
1:访问令牌
2:刷新令牌
根据 Google 文档 "API Client Library for Python: Getting Started" ...
When a user grants your application access, the OAuth 2.0 authorization server provides your application with refresh and access tokens. These tokens are only valid for the scope requested. Your application uses access tokens to authorize API calls. Access tokens expire, but refresh tokens do not. Your application can use a refresh token to acquire a new access token.
从表面上看,这对我来说听起来像是不必要的复杂性。
简单胜于复杂。
为什么我们需要 2?
必须管理 2 的额外复杂性带来了什么好处?
好像这是一个重复的问题。
“刷新令牌的想法是,如果访问令牌被泄露,因为它是短暂的,攻击者可以有限地window滥用它。
刷新令牌如果遭到破坏,将毫无用处,因为除了刷新令牌之外,攻击者还需要客户端 ID 和密码才能获得访问令牌。
Why Does OAuth v2 Have Both Access and Refresh Tokens?