Tôi đang sử dụng IdenetityServer4 và chuyển hướng đến máy khách MVC sau khi Đăng xuất không hoạt động. Sau đây là bộ điều khiển khách hàng MVC của tôi Đăng xuất hành động:IdentityServer4 - Chuyển hướng đến máy khách MVC sau khi đăng xuất
public async Task Logout()
{
await HttpContext.Authentication.SignOutAsync("Cookies");
await HttpContext.Authentication.SignOutAsync("oidc");
}
Sau đây là máy chủ định danh 4 Tệp cấu hình máy chủ.
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
}
}
};
}
Tôi muốn người dùng được chuyển hướng trở lại ứng dụng khách MVC sau khi đăng xuất khỏi IdentityServer. Ngay bây giờ người dùng phải nhấp vào liên kết hiển thị trong hình ảnh dưới đây để chuyển hướng trở lại trang web MVC nhưng tôi nghĩ rằng người dùng nên được tự động chuyển hướng trở lại khách hàng MVC.
phần lỗi xin vui lòng và bản ghi bổ sung. – Lutando