Okta redirectUrl throws 404 error in tomcat

I have an application with Angular + JSP and both of them been kept in one context directory of tomcat.

The application is in tomcat webapps/projectFolder (Angular + JSP i.e. JSP files are kept in nested folder of projectFolder)

The OKTA configuration & authentication is working fine as I can see the token been passed along with redirectUrl but the tomcat throws error of 404.

The redirectUrl is https://website.com/projectFolder/login/callback

We tried to update with different VirtualHost configuration for eg, Alias, Granting all permission to directory, Rewrite rules too but none of them worked. So we are bit confused & blocked on it.

Can we get help?

Hello Team,

Do we have any update on the issue?

We tried with below rewrite rules the default once as per angular documentation.

RewriteEngine On
RewriteBase /projectFolder/

# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html

-Thanks

This looks like a servlet issue from Tomcat rather than Okta.

  1. Check the servlet code if you are handling “/login/callback”?
  2. Check for URL mapping in servelet classes.
  3. Since these URLs are case-sensitive, check your server code if you missed a case or a character.
  4. Check the mappings in your.xml (web.xml, pom…etc.) configuration files. (“logout/callback”)
  5. Check if your index.html is in the right folder ?

This definately looks like a path error, either configured wrongly / or missing from expected location.

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