OAuth2.0概念
OAuth2.0 Concept
我对 OAuth2 密码授权类型概念感到困惑
在 here 中,令牌的实现类似于使用 EndPoint/Claims
在 this site or this blog 中,令牌由 JSON 对象实现,包含所有客户端凭证详情
任何人都可以帮助更好地阐明这个概念吗?
如果您指的是访问令牌,那么它可以是任何一种类型(没有特殊含义的字符串或 JSON、XML 或其他格式)。 OAuth2 specification 表示:
An access token is a string representing an authorization issued to the
client. The string is usually opaque to the client. Tokens
represent specific scopes and durations of access, granted by the
resource owner, and enforced by the resource server and authorization
server.
The token may denote an identifier used to retrieve the authorization
information or may self-contain the authorization information in a
verifiable manner (i.e., a token string consisting of some data and a
signature).
所以这取决于 OAuth2 实现。
如果您指的是 ID token(来自 OpenID Connect),那么它必须是 JWT(已签名 JSON)格式。
有四种 Oauth2 流程可用于获取访问令牌(而非 ID 令牌),具体取决于客户端系统将如何代表最终用户获取访问令牌。使用 OAuth2 密码授予流程,客户端应用程序显示登录页面,获取密码并使用来自授权服务器的 REST API 调用对用户进行身份验证。授权服务器 returns 身份验证成功后给客户端应用程序的令牌。例如移动应用程序,但它不如其他 Oauth2 流程安全,应仅与受信任的客户端应用程序一起使用。我写了一篇关于这个的文章,你可以查看更多细节,link在这里https://www.linkedin.com/pulse/microservices-security-openid-connect-manish-singh
我对 OAuth2 密码授权类型概念感到困惑
在 here 中,令牌的实现类似于使用 EndPoint/Claims
在 this site or this blog 中,令牌由 JSON 对象实现,包含所有客户端凭证详情
任何人都可以帮助更好地阐明这个概念吗?
如果您指的是访问令牌,那么它可以是任何一种类型(没有特殊含义的字符串或 JSON、XML 或其他格式)。 OAuth2 specification 表示:
An access token is a string representing an authorization issued to the client. The string is usually opaque to the client. Tokens represent specific scopes and durations of access, granted by the resource owner, and enforced by the resource server and authorization server.
The token may denote an identifier used to retrieve the authorization information or may self-contain the authorization information in a verifiable manner (i.e., a token string consisting of some data and a signature).
所以这取决于 OAuth2 实现。
如果您指的是 ID token(来自 OpenID Connect),那么它必须是 JWT(已签名 JSON)格式。
有四种 Oauth2 流程可用于获取访问令牌(而非 ID 令牌),具体取决于客户端系统将如何代表最终用户获取访问令牌。使用 OAuth2 密码授予流程,客户端应用程序显示登录页面,获取密码并使用来自授权服务器的 REST API 调用对用户进行身份验证。授权服务器 returns 身份验证成功后给客户端应用程序的令牌。例如移动应用程序,但它不如其他 Oauth2 流程安全,应仅与受信任的客户端应用程序一起使用。我写了一篇关于这个的文章,你可以查看更多细节,link在这里https://www.linkedin.com/pulse/microservices-security-openid-connect-manish-singh