ADFS Authentication Issue in .Net 8

Anonymous
2024-05-03T06:09:59.2233333+00:00

I have an existing ASP.NET MVC application that relies on ADFS authentication. I'm currently upgrading it to .NET 8. As part of the upgrade process, I prioritized implementing the authentication functionality first. However, I'm encountering an issue where the IsAuthenticated property consistently returns false.

builder.Services.AddAuthentication(sharedOptions =>

{

sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;

sharedOptions.DefaultChallengeScheme = WsFederationDefaults.AuthenticationScheme;

})

.AddCookie()

.AddWsFederation(options =>

{

options.MetadataAddress = "https://example.com/FederationMetadata/2007-06/FederationMetadata.xml"; // Replace with your metadata URL

options.Wtrealm = "urn:DevDotNet"; // Replace with your URN

options.Wreply = "https://xyz.com/Home/Index";

}

Can you please help to identify the issue?

Developer technologies ASP.NET ASP.NET Core
Microsoft Security Active Directory Federation Services
Developer technologies .NET Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.