i’m developing a React SPA using Okta authentication. It works flawlessly in localhost but when i tried to deploy the app i get 404 pages after trying to login. I get redirected to /implicit/callback and the browser returns 404.
While I am using VueJS, I have 2 app registrations – one for the app when running locally for dev, one for the app when running in Azure. The configs differ in that the Azure-based instance is running behind a domain with SSL, so the callback URL is not localhost. I just use env to differentiate in the code. Seems to work OK.
However, I also have a callback 404 issue – on my Mac, the localhost callback works fine. Offsite devs running Windows with the same Okta config get a 404 on the implicit/callback.
The reason for returning 404 on production environment is that /implicit/callback is a virtual path generated from index.html file. On local environment there should not be any issues resolving the endpoint, however, when deploying to production, the web server will try to resolve the endpoint physically.
To resolve this issue, your back-end must be configured to redirect requests coming on /implicit/callback endpoint to index.html.
I keep getting a 404 page not found when I try authenticate to my app. I have a React app (OIDC SPA app) on Netlify. I created a redirects file in my public folder.
This is the content of that file:
/* /index.html 200
Could anyone offer me guidance on where to go next?