Im получая бесконечный редирект после того как я вошел в системе.Owin WSFederation бесконечный редирект после Войти
Моего ConfigureAuth.cs, как
//defines default authentication to WSFederation
app.SetDefaultSignInAsAuthenticationType(WsFederationAuthenticationDefaults.AuthenticationType);
//Defines the MetadataAddress and realm
app.UseWsFederationAuthentication(new WsFederationAuthenticationOptions
{
MetadataAddress = ConfigurationManager.AppSettings["ida:AdfsMetadataEndpoint"],
Wtrealm = ConfigurationManager.AppSettings["ida:Audience"]
});
//Defines WSFederation cookie as default authentication type
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType,
});
я могу попасть на страницу входа в ADFS, но когда он возвращается мое приложение постоянно спрашивает ADFS о действительной проверке подлинности после 6 запросов, которые я заблокировал ADFS.
UPDATE 1
Оказывается, мне нужно, чтобы указать эмитента, TokenEndpoint и ключ сертификата, по какой-то причине Owin не получил эти значения из метаданных, поэтому я в конечном итоге копирование значения метаданных и используя их в webconfig в appsettings.
public void ConfigureAuth(IAppBuilder app)
{
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
app.UseCookieAuthentication(new CookieAuthenticationOptions { });
app.UseWsFederationAuthentication(
new WsFederationAuthenticationOptions
{
Wtrealm = ConfigurationManager.AppSettings["ida:Audience"],
AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType,
Configuration = getWsFederationConfiguration()
}
);
}
private static WsFederationConfiguration getWsFederationConfiguration()
{
WsFederationConfiguration configuration = new WsFederationConfiguration
{
Issuer = ConfigurationManager.AppSettings["wsFederation:trustedIssuer"],
TokenEndpoint = ConfigurationManager.AppSettings["wsFederation:issuer"],
};
configuration.SigningKeys.Add(new X509SecurityKey(new X509Certificate2(Convert.FromBase64String(ConfigurationManager.AppSettings["wsFederation:trustedIssuerSigningKey"]))));
return configuration;
}
Да, у меня есть подтверждение авторизации, я просто проверяю, имеет ли пользователь конкретное требование. Но проблема была в том, что по какой-то причине owin не получал значения, которые мне нужны из метаданных (см. Обновление 1) спасибо – BrunoMartinsPro