Hello,
I’m migrating an Angular + .NET Framework (not Core) application from Windows Authentication to Okta. I want it to use redirect login. I have reviewed multiple working examples within my organization and I followed the Okta Hosted Login example on the official Okta GitHub page.
Here are the steps I’ve taken:
- Configured
Startup.cs
exactly as shown in the GitHub example. - Added a global
Authorize
attribute to enforce authentication.
However, after calling UseOktaMvc
in Startup.cs
, my application enters an infinite loop, continuously loading the error and index pages.
Issues Encountered
401 Unauthorized Error: Visual Studio shows this as a request result when I manually redirect the app to the SignIn
action.
No Redirection to Okta Login Page: The application does not redirect to the Okta login page, and I am unsure why.
Additional Information
- The application is using HTTPS, and all configuration values are correct.
- No runtime errors related to Okta.
- Disabled all previous middleware to ensure no interference with Okta.
- Based on examples, I did not modify the Angular code, as the app should redirect to Okta before loading any page elements, including Angular components.
What could be causing my application to fail to redirect to the Okta login page? Is there a need for an additional redirect after UseOktaMvc
, or should the application handle it automatically?
Any insights or suggestions would be greatly appreciated. Thanks!