Kentor MVC注销不呼叫注销网址
问题描述:
我有关于此功能的问题。 登录操作适用于ADFS并返回到AuthServices/Acs 但注销操作不会调用ADFS并直接重定向到returnUrl参数(使用fiddler检查它)。 我打电话此链接:/AuthServices/Logout?ReturnUrl=~/&Status=LoggedOut
Kentor MVC注销不呼叫注销网址
web.config中被设置为这样:
<kentor.authServices entityId="https://localhost:2181/AuthServices" returnUrl="https://localhost:2181/">
<identityProviders>
<add
entityId="https://ADFS DOMAIN/adfs/services/trust"
signOnUrl="https://ADFS DOMAIN/adfs/ls"
logoutUrl="https://ADFS DOMAIN/adfs/ls/?wa=wsignout1.0"
binding="HttpPost"
allowUnsolicitedAuthnResponse="true"
metadataLocation="https://ADFS DOMAIN/FederationMetadata/2007-06/FederationMetadata.xml"
wantAuthnRequestsSigned="true">
<signingCertificate fileName="~/App_Data/*****.cer" />
</add>
</identityProviders>
</kentor.authServices>
如果我在另一个选项卡推出https://ADFS DOMAIN/adfs/ls/?wa=wsignout1.0
,这是工作,我登录页面上的返回从我的网站。
所以它似乎是一个内部问题来检索logouturl并发送它?
感谢您的帮助。
答
有许多问题需要之前注销请求将发出满足的要求:
- 你需要有一个
http://kentor.se/AuthServices/LogoutNameIdentifier
要求及其发行人有权匹配你要登出IDP从。 - 您需要拥有
http://kentor.se/AuthServices/SessionIndex
声明。 - 你AuthServices IDP配置需要一个
logoutUrl
(我看你指定这一点,但也许更容易让AuthServices从元数据读取它) - 您指定与任何签名或两种用途的
ServiceCertificate
(即不只是加密) - 你AuthServices IDP配置有
DisableOutboundLogoutRequests
= 假(这是默认)
失踪索赔(前两个点)是最有可能的问题,如果您有登录过程中的一些声明转换发生或你是不是保留原来的ClaimsIdent性。另请参阅有关ClaimsAuthenticationManager的文档,例如https://github.com/KentorIT/authservices/blob/master/doc/ClaimsAuthenticationManager.md
您可以打开日志记录,看看这些点都没有: https://github.com/KentorIT/authservices/blob/v0.21.2/Kentor.AuthServices/WebSSO/LogOutCommand.cs#L155-L170
谢谢您的答复。 ADFS不会将claimtype发送为http://kentor.se/AuthServices/LogoutNameIdentifier或http://kentor.se/AuthServices/SessionIndex。我如何设置web.config(或者也许是adfs)来做到这一点?但adfs不在我身边。 –
ADFS不发送它们,但默认的AuthServices ACS代码在登录过程中将它们添加到标识中。我在 – explunit
上面的答案中添加了ClaimsAuthenticationManager的链接。另请参阅此处的一些讨论:https://github.com/KentorIT/authservices/issues/665 – explunit