ADFS Authentication Issue in .Net 8

Vijayan, Neethu 0 Reputation points
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?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,566 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,338 questions
Active Directory Federation Services
Active Directory Federation Services
An Active Directory technology that provides single-sign-on functionality by securely sharing digital identity and entitlement rights across security and enterprise boundaries.
1,219 questions
{count} votes