<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
0D51Y00008vdNEeSAMOkta Classic EngineAdministrationAnswered2020-07-20T06:36:32.000Z2020-07-10T21:55:58.000Z2020-07-20T06:36:32.000Z

ColinR.48498 (Customer) asked a question.

okta-react using useOktaAuth() gives accessToken undefined

Hi all,

 

Got an issue when using `okta-react` and using

``` const { authState, authService } = useOktaAuth();``` to get the authState.

Basically, for local and test builds this (npm start) works perfectly, but then during prod builds the authState.accessToken comes back as undefined. However the isAuthenticated is true.

 

 

Battering my head off the keyboard on this one. Any info on what it might be would be greatly appreciated.

 

Versions of dependencies in my react app. I've got a back-end using the spring-boot starter. As I said, it all works well on local (localhost) builds.

 

"@okta/okta-react": "^3.0.0",

"@okta/okta-signin-widget": "^3.9.0",

 

 

----

 

 

PS, I couldn't scroll far enough down to choose a suitable category - so it's a random choice. (there wasn't enough space for all the dropdown choices on this )

 


  • Hi Colin,

     

    Marian here from Okta support, from the details that you have provided, this looks like an issue that our Dev team can help you out with. I would kindly ask you to open a ticket and it will be directed to them or you can also try the forum: https://devforum.okta.com/

     

    Thank you,

    Marian Ungureanu

    Technical Support Engineer

    Okta Global Customer Care

    Expand Post
This question is closed.
Loading
okta-react using useOktaAuth() gives accessToken undefined