Custom Okta Login redirecting to Okta login page

I have built an Application with Okta sign in widget on React JS. Normally when I first used to click login, It used to take me to my login widget on my App (that I had added) and once logged in, I was taken to the home page… But after sometime it started taking me to the okta login after the custom login, I had to login there again to jump to my home page with logged in status.

Is there something I’m doing wrong?

@raghav_m It sounds like a token related issue.

Would you like to open a support ticket through an email to support@okta.com with this issue. One of our Developer Support Engineers will take the case and narrow down the cause of the issue.

Hey @Lijia,
Thanks for your response. But I have figured out what was going wrong.

I had to replace this :

  return this.props.oktaAuth.signInWithRedirect(); 

with this :

  return this.props.oktaAuth.signInWithRedirect({
    sessionToken: res.data.sessionToken  
  }); 

in the onSuccess method (in Login.js).
I’m not sure why we had to add sessionToken as a parameter to the signInWithRedirect, As per the latest changed documentations, It should have stored the session directly (automatically) by using the first method pointed. But well, the second one works for me now.

Thanks. :slight_smile:

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