小编San*_*eep的帖子

IdentityServer4 - 注销后重定向到MVC客户端

在Logout不工作后,我正在使用IdenetityServer4并重定向到MVC客户端.以下是我的MVC客户端控制器注销操作:

public async Task Logout()
{
    await HttpContext.Authentication.SignOutAsync("Cookies");
    await HttpContext.Authentication.SignOutAsync("oidc");
}
Run Code Online (Sandbox Code Playgroud)

以下是身份服务器4主机配置文件.

public static IEnumerable<Client> GetClients()
{
    return new List<Client>
    {
        // other clients omitted...

        // OpenID Connect implicit flow client (MVC)
        new Client
        {
            ClientId = "mvc",
            ClientName = "MVC Client",
            AllowedGrantTypes = GrantTypes.Implicit,

            // where to redirect to after login
            RedirectUris = { "http://localhost:58422/signin-oidc" },

            // where to redirect to after logout
            PostLogoutRedirectUris = { "http://localhost:58422/signout-callback-oidc" },

            AllowedScopes = new List<string>
            {
                IdentityServerConstants.StandardScopes.OpenId,
                IdentityServerConstants.StandardScopes.Profile
            }
        }
    };
} …
Run Code Online (Sandbox Code Playgroud)

identityserver4

11
推荐指数
2
解决办法
1万
查看次数

标签 统计

identityserver4 ×1