gpt4 book ai didi

Azure AD 无法访问 login.microsoftonline.com/{tenantId}

转载 作者:行者123 更新时间:2023-12-02 07:27:56 24 4
gpt4 key购买 nike

我正在尝试通过 Azure Active Directory 为我的应用程序创建身份验证,但运气不佳。

我在 Portal.azure.com 中创建了一个新的 Azure Active Directory 实例并复制了“目录 ID”(单击 Azure Active Directory,然后单击属性),但仍然无法进行身份验证。

我正在尝试使用https://login.microsoftonline.com/ {租户ID}。关于我可能做错了什么或需要在门户中尝试什么有什么建议吗?

答案:上述内容本身并不能直接起作用。

您必须设置 OWIN 并启用 OWIN 启动类。

启动类应该是这样的:

app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

app.UseCookieAuthentication(new CookieAuthenticationOptions());

app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = "{Registered app object id}", //This value is found in the app configuration page and is app specific
Authority = "https://login.microsoftonline.com/{tenantId}" //This value will NEVER change as it is the tenant ID
});

最佳答案

我知道该问题已得到解决,但我想为其他有相同问题的人添加更多信息:我的建议是按照 this tutorial 的步骤操作这解释了您需要执行的操作以及向这些字段添加的内容,例如 TenantId 或 ClientId。

关于Azure AD 无法访问 login.microsoftonline.com/{tenantId},我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48077455/

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