gpt4 book ai didi

oauth-2.0 - “Resource Owner Password Flow” 和 “Implicit grant” 之间的区别

转载 作者:行者123 更新时间:2023-12-05 06:35:19 25 4
gpt4 key购买 nike

The implicit grant is a simplified authorization code flow optimizedfor clients implemented in a browser using a scripting language suchas JavaScript.

The resource owner password credentials (i.e., username and password)can be used directly as an authorization grant to obtain an accesstoken.

( https://www.rfc-editor.org/rfc/rfc6749#section-1.2 )

我的问题是了解这两种资助类型有何不同?

最佳答案

此处重要的是了解您输入凭据的方式和位置。

隐式

您的应用是 https://example.com对于身份验证,您将前往 https://auth.some-domain.com (甚至 https://auth.example.com )。身份验证成功后,用户将被重定向到 https://example.com/some-callbackurl?#token=token-value .

注意点:URL中的重定向和token

资源所有者密码流程

您的应用是 https://example.com对于身份验证,您将前往 https://example.com (或 https://example.com/login )。身份验证成功后,用户将被重定向到 https://example.com/home .

注意点:URL 中没有重定向和 token 交换

基本上,如果您拥有应用程序(客户端应用程序、服务器应用程序、授权应用程序),那么这就是您要做的事情。基本上你是负责身份验证的人——而不是第三方应用程序。您信任您的客户端应用。

https://example.com/login从用户那里获取凭据并执行 HTTP REST POST(例如)调用并获取响应作为 token (和刷新 token - 可选)。它将它保存在 localStoragecookie 中,然后重定向到主页或它必须重定向到的任何页面。

没有重定向发生在交换中。

关于oauth-2.0 - “Resource Owner Password Flow” 和 “Implicit grant” 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49713385/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com