<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z000099okMmCAIOkta Classic EngineAuthenticationAnswered2024-07-27T09:00:27.000Z2023-05-03T21:33:42.000Z2023-05-04T20:09:33.000Z

0rzhe (0rzhe) asked a question.

How to sync my next-auth session with my Okta session?

I am utilizing the next-auth package with the Okta Provider. When the user signs in, a session is created, but that session doesn't adhere to any of the authorization rules set in Okta (max session age, etc). Further, if I clear a user's session through the Okta admin dashboard, the user is not logged out as the 'getSession()' is only returning the next-auth session and not respecting the Okta session.

 

Why does it seem like there are two separate sessions created when a user logs in with next-auth using Okta and how to sync the sessions?


  • Paul S. (Okta, Inc.)

    Hello @0rzhe (0rzhe)​ Thank you for reacting out to our Community!

     

    Please see this doc that should provide the required info for the session import:

    https://thetombomb.com/posts/nextjs-nextauth-okta

     

    Additionally if you need further assistance we recommend to leverage the Okta Developer forums for this type of questions and take advantage of their expertise.

    https://devforum.okta.com/

     

    Community members help others by clicking Like or Select as Best on responses. Try it today.

    Expand Post
This question is closed.
Loading
How to sync my next-auth session with my Okta session?