{ -6ren">
gpt4 book ai didi

azure - 尝试使用 Microsoft 帐户登录时收到 "unauthorized_client"

转载 作者:行者123 更新时间:2023-12-01 23:47:52 25 4
gpt4 key购买 nike

在我的 IS4 的 Startup.cs 中:

services.AddAuthentication()
.AddMicrosoftAccount(o =>
{
o.SignInScheme = IdentityServer4.IdentityServerConstants.ExternalCookieAuthenticationScheme;
o.ClientId = "clientId";
o.ClientSecret = "clientSecret";
});

我已经定义了范围:

  • openid
  • 个人资料

尝试登录后出现错误:

unauthorized_client:客户端不存在或未为消费者启用。如果您是应用程序开发人员,请通过 Azure 门户中的应用程序注册配置新应用程序:https://go.microsoft.com/fwlink/?linkid=2083908 .

这是一个网络应用程序。那么我在这里做错了什么:

我假设客户端 ID 是这样的: enter image description here

我的客户 secret 是这样的: enter image description here

我还设置了重定向 URI:

enter image description here

最佳答案

该错误表示未为个人帐户(您的情况为 Microsoft 帐户)设置支持的帐户类型

要解决此问题,请导航至应用注册的 Manifest,设置两个属性 accessTokenAcceptedVersionsignInAudience像下面这样。

"accessTokenAcceptedVersion": 2,
"signInAudience": "AzureADandPersonalMicrosoftAccount"

保存设置时,请确保您的应用满足 validation 的要求,否则会出现一些错误。

关于azure - 尝试使用 Microsoft 帐户登录时收到 "unauthorized_client",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63924622/

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