我有一個工作正常的IdentityServer2 auth服務器。我正在創建一個新的.NET MVC應用程序,並按照這篇文章(http://www.cloudidentity.com/blog/2014/02/20/ws-federation-in-microsoft-owin-componentsa-quick-start/)設置帶有IDS2的MS OWIN。我可以訪問登錄屏幕,但登錄後,用戶被髮回到調用網站並陷入無限循環。OWIN/IdentityServer登錄卡在無限循環中
Startup.Auth.cs
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.WsFederation;
using Owin;
namespace AZBarMail
{
public partial class Startup
{
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(
new CookieAuthenticationOptions
{
AuthenticationType =
WsFederationAuthenticationDefaults.AuthenticationType
});
app.UseWsFederationAuthentication(
new WsFederationAuthenticationOptions
{
MetadataAddress = "https://auth.azbar.org/federationmetadata/2007-06/federationmetadata.xml",
Wtrealm = "https://localhost:44310/",
});
}
}
}
web.config中的部分
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.6.1" />
</system.web>
Startup.cs
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(AZBarMail.Startup))]
namespace AZBarMail
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
重定向URL在IDS2
https://localhost:44310/
有沒有機會記得你在這裏做了什麼?我目前面臨同樣的問題。 – Drew