Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am doing research on how to use Windows authentication be default, but being able to use a different authentication process if the user is not accessing site when connected to the VPN. I have created the boilerplate MVC web application and in program.cs have set the DefaultScheme, DefaultChallengeScheme, and DefaultAuthenticateScheme to be NegotiateDefaults.AuthenticatinoScheme in AddAuthentication(). I have also chained AddNegotiate(), AddCookie(), and AddopenIdConnect() after the AddAuthentication() function. Next, I decorated the Home and Privacy actions with a plain [Authorize] attribute. When I fire up the app in VS, the Home action properly navigates through the Negotiate authentication path. However, when I click the Privacy link the processing attempts to use OIDC. I cannot figure out why OIDC authentication is being attempted when the defaults all indicate Negotiate should be used. Has anyone encountered this and determined the cause?

What I have tried:

I have changed the order of the function chaining, but that did nothing. I have searched using multiple different prompts, but have not found anyone else who has encountered this.
Posted
Comments
Andre Oosthuizen 6-Mar-24 14:45pm    
You need to show us what code is used in your 'Startup.cs'/config file for us to determine if you are configuring the authentication services correctly. Also, do you have all of the correct/necessary packages installed?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900