How to authenticate user at the MVC Controller level and On aspx page_load using Embedded SSO SignIn Widget - ASP.NET MVC Web application

Hello Team,

I have implemented the Embedded SSO SignIn widget in my ASP.NET Web application. On Successful login, I am receiving the claim identity along with tokens.

My application is mix of aspx and MVC pages hence, it difficult for me understand how I can authenticate the user while redirecting from one page to another.

Please help me understand, How I can do a code implementation to check user authentication/active session on page load (either aspx or MVC controller action).

Below code sample is I am using at the first time of the user login. I want to authenticate the user on every page redirect.

Thanks, Looking for your help.

Hi @Saurabh126 You can add the the [Authorize] attribute before loading a view, this will limit access to that component to authenticated users.


Hello @Regis Thanks for your help.

one follow up questions, I can use [Authorize] attribute for MVC controllers however, how I can validate the user on .ASPX page because my application is mix of aspx and MVC pages ?

Looking for your help.

Hi @Saurabh126 ,

You may want to look at our Okta Webform sample using aspx:

We also have a blog post giving more explanation on webforms:

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