We use SAML and I am using the latest version System.IdentityModel.Token 8.0.0
WsFederation authneitcaton in .net 8
We were using .Net 7 WSFederation successfully. We have now moved to .Net 8 and the authentication has stopped working. Can anybody advise what has changed?
We are using WsFederation 8.0.7 and Microsoft.IdentityModel.Tokene 8.0.0.
Our code is :-
public static IServiceCollection AddWsFederationAuthentication(this IServiceCollection services, ConfigurationManager configuration)
{
services.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = WsFederationDefaults.AuthenticationScheme;
})
.AddCookie()
.AddWsFederation(options =>
{
options.Wtrealm = "www.host.com";
options.MetadataAddress = "https://microosftOnline etc";
options.Events = new WsFederationEvents
{
OnAuthenticationFailed = context =>
{
// Handle authentication failure
context.Response.Redirect("/Host/error");
return Task.CompletedTask;
}
};
});
return services;
}
We get an error stating Microsoft.IdentityModel.Tokens.SecurityTokenException: No token validator or token handler was found for the given token
---> System.AggregateException: One or more errors occurred. (IDX10204: Unable to validate issuer. validationParameters.ValidIssuer is null or whitespace AND validationParameters.ValidIssuers is null or empty.) (IDX30011: Unable to read XML