ASP.NET Webforms IsAuthenticated and User not being set

I have the MVC Example project configured to use my dev okta SSO.
I have modified my actual application to use the same code and values.

With the example app I can log in and view the profile page showing the correct user data and log out.
With my real application:

  1. If I am not already logged in, I will get the login page as expected. After logging in I am redirected to my external login page where I expect to be redirected to after logging in. Except: Request.IsAuthenticated is False and Page.User.Identity.isAuthenticated is also false.
  2. If I start a new debugging session after #1 I will not be redirected to the okta login, and instead go straight to my external login page where I am once again told I am not not authed.
  3. If I now launch the Example project, I will also skip the okta login but if I debug the profile page, I can see that IsAuthenticated is true and the Page.User object is filled in corrected.
  4. if I now click logout using the example app I get logged out as expected.
  5. If I launch my real app, I will now be redirected to the okta login page.

To summarize.
The app knows if the login should be shown or not.
The app does not know if the user is authorized after successfully logging in.

Any ideas why I have this disconnect?

Thank you,

I finally tracked down the issue. In the CookieAuthenticationOptions I had a carry over value from my old auth system that specified a value for AuthenticationType. After removing that parameter I get the User object populated as expected. Hopefully this is of help to someone else. :+1:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.