Okta login callback redirects to base

HI Team ,
i am trying to use Okta with react i configured the

 <Security issuer='https://${yourOktaDomain}/oauth2/default'
              clientId='{clientId}'
              redirectUri={window.location.origin + 'home/implicit/callback'}

i am configured redirectUri attribute in okta server to http://localhost:3000/home/implicit/callback
then i am entering url http://localhost:3000/home in my browser click enter ,then it ask credentials to okta login, once login process is completed the site is rediteced to http://localhost:3000/home and immediately again redirected to http://localhost:3000 i am expecting to reditect to http://localhost:3000/home but some how its again redirected to base, how can i stop redirecting to base again
okta routers are configured in react as below

  •     <Route  path="/home/implicit/callback" component={LoginCallback} />  
    
  •     <Switch>
    
  •         <Route  path='/home' component={Home} />
    
  •         <OktaSecuredRoute  path='/profile' component={Profile} />
    
  •   	</Switch>
    
  •   	</Router> 
    

please shade some light on this problem , what is wrong in my configuration

Hi Phani, based on the code snippets you provided I’m assuming you’re using the Okta React library. According to their documentation, it looks like it is expected behavior when you use the LoginCallback component. https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react#logincallback

LoginCallback handles the callback after the redirect to and back from the Okta-hosted login page. By default, it parses the tokens from the uri, stores them, then redirects to / . If a SecureRoute caused the redirect, then the callback redirects to the secured route. For more advanced cases, this component can be copied to your own source tree and modified as needed.

Thank you very much warren, now i understood , i am worried whats wrong in my configs, but you clarified now , thanks again , if you have some free time please elaborate “this component can be copied to your own source tree and modified as needed” or link for reference example code. thanks in advance.
with regards,
phani

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