We are developing an angular application which consumes okta.
We have successfully done integration in localhost. While we hosted the application with tomcat server we are not able to land on the redirect url instead it throws 404 error as below
HTTP Status 404 - /stp-okta/home
type Status report
message /stp-okta/home
description The requested resource is not available.
Apache Tomcat/8.0.20
we have done the following settings in app.module.ts. Where application resides in stp-okta folder under webapps.
Below is the configuration which we have done in app.module.ts
You’ll have to configure Tomcat so it knows you’re serving up a SPA and everything redirects to index.html. We do this in JHipster with a ClientForwardController that sends all requests to the root.
Now it’s working fine when I added below code in confg/web.xml in tomcat serve. It’s correct tomcat not able to identify SPA application.
…
error-page
error-code 404 error-code
location /index.html location
error-page
…
If you’re using hash-based routing, I believe your URL will be #home rather than /home. However, you can’t put hashes in redirect URIs, so that could create a problem. I found this, which might help: