Validate logged in user's session withing the application

Hello,
We have a MVC .Net Application,
Using the Authentication API , by passing the username and password, we are authenticating the user from OKTA. We have our self hosted login which we are using.
Once we have authenticated the user, using the Session token we are creating the session for the user using the API call https://XXXXX.oktapreview.com/api/v1/sessions?additionalFields=cookieToken

In the response of this we are getting the CookieToken back along with some other fields.

Can you please suggest a sample code for this or any other way we can achieve this?
We are at the point where we are getting the CookieToken back but further having difficulties putting a validation on all the pages for validate the user’s session.

Also please suggest a best way to validate User’s login withing the application.

Please advise.

Thank you.

Hi @jaynishp

If the call to /api/v1/authn for user authentication is done through the back-end channel, then you can validate the user’s credentials and then create a local session/cookie inside your application for easier session validation when a user accesses a specific route.

You can use the Okta authentication SDK available here to perform the authentication process.