<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
0D51Y00008C1nDuSAJOkta Classic EngineSingle Sign-OnAnswered2020-04-13T12:29:20.000Z2020-04-03T20:44:15.000Z2020-04-13T12:29:20.000Z

elvisl.77141 (Customer) asked a question.

Okta-react package module doesn't work as static files from express server

I have deployed my app using express.js on the backend and react.js on the front-end. After I ran 'npm run build' and reference the build directory from Express, I was able to get my app to render the react components through the server-side.

 

The issue here is when making calls to the '@okta/okta-react' package such as okta.signIn(), I first got a 401 api/ Authentication error thinking it was a CORs or related problem. After further debugging, starting up client-side (npm start (dev), NOT npx serve(prod)), the okta.signIn() works.

 

Does the '@okta/okta-react' package not work in Production? Is it because I'm serving this as a static file through express? What is the solution here? Do i have to implement the okta server side instead, if so, whats the purpose of the react package?

 

Reason for using express:

  • True HTTPS server-side
  • Mailer Integration
  • Other Third-party integration

  • User1580983851170723709 (Vendor Management)

    Hi Elvis,

     

    This is Dragos from Okta Support, based on the description provided, it might need some more troubleshooting on this. For that please send an email at Okta Developer Support (developers@okta.com) and one of our engineers will assist you on this matter.

     

    Thank you,

    Dragos Paval

    Technical Support Engineer

    Expand Post
This question is closed.
Loading
Okta-react package module doesn't work as static files from express server