asp.net-core - 如何使用 Sustainsys 发起 SLO 请求
问题描述
尝试使用 Okta 获取 Single Log out 请求
我尝试在 Sustainsys 上使用示例代码,如下所示:
public async Task<IActionResult> Logout()
{
await _signInManager.SignOutAsync();
_logger.LogInformation("User logged out.");
return SignOut(new AuthenticationProperties()
{
RedirectUri = "/Index"
},
Saml2Defaults.Scheme);
}
但这似乎并没有调用 Single Log Out。我只是被重定向到我的注销页面。从我读过的内容来看,它是受支持的,所以不确定我应该调用什么。在启动时,我加载了其中包含 SLO url 的元数据,因此它应该知道指向哪里。
Okta 需要一个证书,所以我在我的启动中添加了相关的 pfx 文件,如下所示:
// Add Saml Athentication
var authBuilder = services.AddAuthentication();
authBuilder.AddSaml2(options =>
{
// SAML Okta options
options.SPOptions.EntityId = new EntityId(Configuration["SAML:AudienceURI"]);
// Set up redirect to SAML controller callback to handle log in after SAML Authentication (For Okta/IDP initiated log in)
options.SPOptions.ReturnUrl = new Uri(Configuration["SAML:ReturnURL"]);
// Scheme to handle the authentication
options.SignInScheme = IdentityConstants.ExternalScheme;
options.SignOutScheme = IdentityConstants.ApplicationScheme;
// Set up Identity Provider
var identityProvider = new IdentityProvider(
new EntityId(Configuration["SAML:EntityID"]),
options.SPOptions)
{
Binding = Saml2BindingType.HttpRedirect,
LoadMetadata = true,
MetadataLocation = Configuration["SAML:MetadataURL"],
AllowUnsolicitedAuthnResponse = true
};
options.SPOptions.ServiceCertificates.Add(new X509Certificate2("Okta.pfx", ""));
options.IdentityProviders.Add(identityProvider);
});
有任何想法吗?我必须手动完成吗?如果是这样,任何指针都会很棒。
解决方案
好的,一定错过了这个,但答案是重定向到 /Saml2/Logout
这仍然不起作用,因为不存在注销所需的声明,但此步骤可能对某人有所帮助。
推荐阅读
- android - 使用 Android Studio 在标签上写入 NFC 数据
- here-api - 交通流中响应变量的含义
- python - win32com和IPICalculation二级接口
- mysql - MySql 在特定条件下插入重复、替换或忽略时
- image - 在 docker 容器中安装 Dynamics 365 CE V9
- mysql - 虚拟表编辑特定行而不在Delphi中移动光标
- amazon-web-services - Bitbucket CI/CD 管道 - 使用 Elastic Beanstalk 部署到 AWS
- highcharts - 散点图点击事件在下面的点触发
- google-cloud-sql - 如何使用私有 IP 将 Cloud Composer 连接到 Cloud SQL 实例?
- vba - Outlook 使用 IM 回复并发送电子邮件让收件人知道