我已经接管了一个项目,并且其他事情需要一些包升级,所以我从这些事情开始......
<package id="Kentor.AuthServices" version="0.18.0" targetFramework="net452" />
<package id="Kentor.AuthServices.Owin" version="0.18.0" targetFramework="net452" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net452" />
对这些...
<package id="Sustainsys.Saml2" version="2.2.0" targetFramework="net472" />
<package id="Sustainsys.Saml2.Owin" version="2.2.0" targetFramework="net472" />
<package id="Microsoft.Owin" version="4.0.0" targetFramework="net472" />
<package id="Microsoft.Owin.Host.SystemWeb" version="4.0.0" targetFramework="net472" />
<package id="Microsoft.Owin.Security" version="4.0.0" targetFramework="net472" />
<package id="Microsoft.Owin.Security.Cookies" version="4.0.0" targetFramework="net472" />
我遵循了迁移指南,但当我的 Web 窗体项目中出现挑战时,无法重定向到 SingleSignOnService 位置。
我的 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;
我试过在路径映射中触发挑战......
ctx.Authentication.Challenge(new AuthenticationProperties()
{
RedirectUri = "https://demo.local"
});
我的问题是我是否将 Owin 软件包升级得太远,是否有人有一些故障排除提示?