【发布时间】:2018-12-22 09:17:26
【问题描述】:
将 OOTB MVC5 与 AAD 模板一起使用,无需任何修改。
我想要做的是在 AAD 的身份验证后将其他自定义声明添加回我的应用程序。 ConfigureAuth:
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
AuthenticationType = CookieAuthenticationDefaults.AuthenticationType,
});
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
RedirectUri = "https://localhost:44336/Account/Signin",
PostLogoutRedirectUri = postLogoutRedirectUri
});
}
在 Azure 门户中,应用程序的回复 URL 也按上述方式输入。应用程序的实际行为是,在 AAD 登录后,重定向只是回到应用程序的根 /,并且没有命中 Account 控制器上的 Signin 操作。
任何想法为什么?我错过了什么?
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-5 azure-active-directory owin