React JS OKTA deploy in IIS

the okta code with react is working on my vs code laptop, after deploying it on IIS I have issue after logging in OKTA its saying 404 file or directory not found

these are the version of react and OKTA in my application
@okta/okta-auth-js”: “^7.12.1”,
@okta/okta-react”: “^6.10.0”,
@okta/okta-signin-widget”: “^5.5.0”,
“react-print”: “^1.2.4”,
“react-redux”: “^5.0.7”,
“react-router”: “^4.3.1”,
“react-router-dom”: “^5.3.4”,

redirectUri: ‘https://localhost:9090/login/callback

show home page with login button > OK
redirect to OKTA page to enter email add and pass > OK
redirect to https://localhost:9090/login/callback?code=YbEgaAZ9m6M1wLb_T3eeMl3LD625E_doa64B7wfkoWY&state=AzOFMpHqZJ6CMTB3Spf… > Error

Hi there @mark.cabantog ,

Welcome to the community!

In order to host a SPA on a web server, you’ll need to configure url rewrite rules. This is something automatically handled when serving locally by dev tooling, but it is required manual configuration for the web server you are hosting on. You’ll need to configure the host to serve the index.html file for all routes to handle client-side routing correctly.

You can search for IIS url rewrite rules for SPAs as your specific scenario may be unique, but here’s a generic examples written for Angular that does something similar.

Happy coding!

1 Like

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