【发布时间】:2019-01-15 09:07:00
【问题描述】:
与 Kentor.AuthServices.Owin 0.18.0 和通常此流量日志一起工作。
200 GET https://some-saml2-idp.com/saml2/idp/SSO_1..39%3D&RelayState=Os..j
302 POST https://demo.local/AuthServices/Acs
200 GET for the set RedirectUri
升级到 Sustainsys.Saml2.Owin 2.2.0 后,我收到此流量日志...
200 GET https://some-saml2-idp.com/saml2/idp/SSO_1a7f5..sy%2Fh9rebTw%3D%3D&RelayState=1M..3c
302 POST https://demo.local/AuthServices/Acs
303 GET https://demo.local/login?error=access_denied
200 GET https://some-saml2-idp.com/saml2/idp/SSO_1a7f..NfLr6E299uPwE%3D&RelayState=cS..L
302 POST https://demo.local/AuthServices/Acs
404 GET https://demo.local/saml2/idp/SSO_1..39?SAMLRequest=hZ..bTw==&RelayState=1M..c&error=access_denied
我尝试过清除所有地方的 cookie,并试图找到任何负责错误或错误参数的“自己的”代码。
如果我可以在不改变 IDP 方面的任何内容的情况下让我的两个分支机构都工作,我会更愿意。
我的 Web.config 具有以下结构...
<sustainsys.saml2 entityId="https://demo.local/AuthServices"
returnUrl="https://demo.local"
publicOrigin="https://demo.local"
modulePath="/AuthServices">
<serviceCertificates>
<add fileName="~/somename.pfx"
use="Signing" />
</serviceCertificates>
<identityProviders>
<add entityId="My-IDP"
allowUnsolicitedAuthnResponse="true"
loadMetadata="true"
metadataLocation="https://some-saml2-idp.com/metadata" />
</identityProviders>
</sustainsys.saml2>
还有我的 Owin 创业公司……
var defaultSignInAsAuthType = "Cookies";
app.SetDefaultSignInAsAuthenticationType(defaultSignInAsAuthType);
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = defaultSignInAsAuthType,
ReturnUrlParameter = "returnUrl",
LoginPath = new PathString("/login"),
LogoutPath = new PathString("/logout")
});
var saml2Options = new Saml2AuthenticationOptions(true);
app.UseSaml2Authentication(saml2Options);
app.UseStageMarker(PipelineStage.Authenticate);
AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.Name;
为了模仿旧包设置的行为,我缺少什么?
【问题讨论】:
-
看起来第一次访问 /AuthServices/Acs 会导致某种错误。请启用 katana 日志记录,看看是否有任何信息。
-
啊,谢谢。在添加 minIncomingSigningAlgorithm="w3.org/2000/09/xmldsig#rsa-sha1" 作为日志显示我时得到了进一步的结果。
-
是的,这是另一个已更改的默认设置(从安全角度来看更好)现在可以使用吗?在这种情况下,我会将其添加为下一个有相同问题的人的问题的答案。
-
是的!在那之后并添加一个触发我的 ClaimsAuthenticationManager 的 HttpModule 我回到了与我希望的旧设置相同的状态。还将 .NET Framework 升级到 4.7.2 和解决方案中的许多包。
-
好 - 我总结了一个答案。请检查 HttpModule - 你在做一些奇怪的事情。使用
AcsCommandResultCreated通知而不是 ClaimsAuthenticationManager。
标签: owin sustainsys-saml2