<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
0D54z0000A45O97CQEOkta Classic EngineAuthenticationAnswered2025-04-25T09:00:14.000Z2024-03-24T23:14:48.000Z2024-04-01T14:40:11.000Z

z9wul (z9wul) asked a question.

preserve the state of a nested oidc flow

hello all,

I have the following scenario:

  1. user arrives on site A and wants to login
  2. site A initiates an OIDC flow with OKTA and arrives to OKTA's login page
  3. on OKTA's login page, the user initiates another OIDC login flow with site B
  4. once the user is logged in to site B, a code returns to OKTA which is successfully changed with a session
  5. BUT it seems that OKTA loses the context - and doesn't redirect back to site A with its own code

 

tl;dr -

expected: siteA -> OKTA -> siteB -> OKTA -> siteA

actual: siteA -> OKTA -> siteB -> OKTA dashboard

 

some more details:

from siteA, arriving to the OKTA's page: /oauth2/v1/authorize , with the following QS params:

  • client_id
  • response_type: code
  • scope: openid email profile
  • redirect_uri: siteA's code endpoint
  • state

 

when initiating the OIDC flow from the above OKTA page to siteB, i'm calling OKTA's endpoint: /sso/idps/{clientId}

i've tried forwarding the `state` - but it was ignored.

 

 

any idea?


  • Mihai N. (Okta, Inc.)

    Hi @z9wul (z9wul)​ , Thank you for reaching out to the Okta Community! 

     

    I'm not sure if this flow is supported, but this question is more appropriate for our dedicated Okta Developer Forum.

    My advice would be to reach out via devforum.okta.com to take advantage of their expertise.  

    While we'll do our best to answer all of your questions here, this medium is more inclined towards Okta core products and features (non-developer work). 

    In the meantime, you can review the following post that seems to discuss a similar experience, although they mentioned it being in conjunction with Google Login: https://devforum.okta.com/t/oidc-login-redirect-not-working/14039

     

     

     

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope my answer helps! 

     

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
  • Mihai N. (Okta, Inc.)

    Hi @z9wul (z9wul)​ , Thank you for reaching out to the Okta Community! 

     

    I'm not sure if this flow is supported, but this question is more appropriate for our dedicated Okta Developer Forum.

    My advice would be to reach out via devforum.okta.com to take advantage of their expertise.  

    While we'll do our best to answer all of your questions here, this medium is more inclined towards Okta core products and features (non-developer work). 

    In the meantime, you can review the following post that seems to discuss a similar experience, although they mentioned it being in conjunction with Google Login: https://devforum.okta.com/t/oidc-login-redirect-not-working/14039

     

     

     

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope my answer helps! 

     

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
This question is closed.
Loading
preserve the state of a nested oidc flow