IdentityServer4 を使用する MVC アプリケーションがあります。IdentityServer4 では、SAML2 (SustainSys.SAML2) を外部ログイン プロバイダーとして登録しました。ログインは正常に機能します。
ユーザーが MVC アプリケーションからログアウトすると、MVC アプリケーションからログアウトされますが、外部ログイン プロバイダーのログアウトはトリガーされません。外部認証スキームへのリダイレクトを行うアイデンティティ サーバーの LogOut メソッドを確認しました。しかし、リダイレクトは起こりません。
this triggers a redirect to the external provider for sign-out
return SignOut(new AuthenticationProperties { RedirectUri = url },
vm.ExternalAuthenticationScheme);
そして、これが SAML の外部 ID プロバイダーを登録したコードです。SustainSys SAML の Nuget パッケージを使用しました。
.AddSaml2(options =>
{
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.SignOutScheme = IdentityServerConstants.SignoutScheme;
options.SPOptions = CreateSPOptions();
var idp = new IdentityProvider(new EntityId(_strIDPEntityId), options.SPOptions)
{
AllowUnsolicitedAuthnResponse = true,
Binding = Saml2BindingType.HttpRedirect,
SingleSignOnServiceUrl = new Uri(_strSingleSignOnURL),
SingleLogoutServiceBinding = Saml2BindingType.HttpRedirect,
SingleLogoutServiceUrl = new Uri("https://devit-dev.onelogin.com/trust/saml2/http-redirect/slo/1111")
};
idp.SigningKeys.AddConfiguredKey(
new X509Certificate2(
AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "../../../App_Data/OneLogin.cer"));
options.IdentityProviders.Add(idp);
});
ここで何が欠けているのかわからない。どんな助けにも感謝します。