gpt4 book ai didi

azure - 即使有多个帐户可用,Microsoft oauth 帐户选择也默认为上次使用的帐户

转载 作者:行者123 更新时间:2023-12-02 05:54:22 25 4
gpt4 key购买 nike

我正在使用 Microsoft OAuth2 来获取我的应用程序的访问 token 。正常的 Oauth 流程工作正常,但如果我有多个帐户,它总是默认为最后使用的帐户,而不让我选择一个帐户,即使它在列表中可用。

我能想到的唯一替代方法是使用 prompt=login但这太具有侵入性,尤其是对于每次登录。

我的 oauth 网址

身份验证请求:https://login.microsoftonline.com/common/oauth2/authorize?client_id=<myAppId>&response_type=code&redirect_uri=<myUrl>&scope=User.Read&state=1111

token 请求:https://login.microsoftonline.com/common/oauth2/token?client_id=<myAppId>&client_secret=<myAppSecret>&redirect_uri=<myUrl>&code=<codeFromPreviousCall>&grant_type=authorization_code

是否可以设置参数来让用户选择帐户?

请查看下面的 gif,并注意我没有点击第二页中的任何帐户 Microsoft Account selection

最佳答案

您可以使用prompt=select_account

select_account: The user is prompted to select an account, interrupting single sign on. The user may select an existing signed-in account, enter their credentials for a remembered account, or choose to use a different account altogether.

关于azure - 即使有多个帐户可用,Microsoft oauth 帐户选择也默认为上次使用的帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57210360/

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