Post_Logout_Redirect_Uri使用天蓝色的身份验证时不会重定向

问题描述 投票:3回答:1

如Microsoft示例项目中的Readme.md所述,使用OWIN和OpenId对Azure Active Directory的基本Web应用程序的用户进行身份验证:https://github.com/Azure-Samples/active-directory-dotnet-webapp-openidconnect

以下项目在我的web.config中:

<add key="ida:PostLogoutRedirectUri" value="https://localhost:44320/" />

Startup.Auth如下:

    private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
    private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
    private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
    private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];

    string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);

    public void ConfigureAuth(IAppBuilder app)
    {
        app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

        app.UseCookieAuthentication(new CookieAuthenticationOptions());

        app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
                ClientId = clientId,
                Authority = authority,
                PostLogoutRedirectUri = postLogoutRedirectUri,
                RedirectUri = "https://localhost:44320/Home/About",
                Notifications = new OpenIdConnectAuthenticationNotifications
                {
                    AuthenticationFailed = context => 
                    {
                        context.HandleResponse();
                        context.Response.Redirect("/Error?message=" + context.Exception.Message);
                        return Task.FromResult(0);
                    }
                }
            });
    }
}

但是,即使重定向URI将microsoft.com网站放入其URL enter image description here,它也不会重定向

azure owin azure-active-directory
1个回答
0
投票
我面临着同样的问题。注销后无法重定向到我的应用程序。
© www.soinside.com 2019 - 2024. All rights reserved.