cPanel Tomcat7 with domain fails to redirect spring security url j_spring_security_check - spring

I am using cpanel WHM 11.44 (supports tomcat 7.0.42) on my Centos VPS. I have creating a domain (www.testdomain.com) using WHM and install servlet on it.
Inside /home/testdomain/ jsptest.jsp is created and successfully loaded that page. On that I have uploaded my spring mvc application with spring security(MyApps.war). My application MyApps.war is extracted inside /home/testdomain.
As per cpanel tomcat7 documentation, I have added JkMount /MyApps/* ajp13 on cp_jkmount.conf file.
https://documentation.cpanel.net/display/EA/Introduction+to+Tomcat
Now I can access my tomcat application using www.testdomain.com/MyApps. That is successfully loaded and redirected to www.testdomain.com/MyApps/index.jsp. (login page)
After login I can see www.testdomain.com/MyApps/j_spring_security_check with error message.
(Not Found : The requested URL /MyApps/j_spring_security_check was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache Server at www.testdomain.com Port 80).
Actually MyApps is working fine on my local computer.
I know cPanel Tomcat 7 is shared on each domains. So What I am missing on shared tomcat with spring security. Please help me move forward.

Related

Spring Boot - how to automatically redirect user from www domain to non-www domain?

I have classic Spring Boot application on my VM.
A user can go to https://www.fakeurl.com which is pointing to my VM , or, a user can go to https://fakeurl.com which is pointing to my VM.
The problem is that this is bad for SEO. When a user goes to https://www.fakeurl.com (with www) I need to automatically redirect him to non-www domain https://fakeurl.com
How can I do this in SpringBoot?

How can I setup keycloak and Spring to use HTTPS when redirecting to login page

I'm trying to reach a Spring Boot API hosted on a server with my Angular application, but I have some CORS issues.
CORS Error in the console
Redirection Flow
I tried several things, I added my URLs in both keycloak and Spring, and I think I found the origin of the problem but can't seems to resolve it.
I believe the problem comes from the fact that keycloak redirects to http://user-service.cubetech-app.fr/sso/login instead of the HTTPS version of that url. I read that when the browser detect a redirection on a different hostname it change the Origin header to null, and I think this is what creates the CORS error.
I don't know how to force HTTPS on the internal redirection.
For further informations, my spring backend and my keycloak server are hosted on my VPS, in a docker, and behind a traefik reverse-proxy that enables HTTPS with Let's Encrypt.
Check the webOrigins value of the client you use in Keycloak.
Realm settings-> clients -> {your client}

401 Unauthorized accessing Web API withing Javascript

I have web api that uses windows authentication. I've created my own Active Directory Server and a separate IIS Server. I have registered the IIS server to the domain but for some reason I'm getting a 401 issue when I use the API URL in my Javascript.
But works when using it directly from web browser
Please note that this is the same code (javascript, SQL Server, and ASP.NET Web Api) I'm developing at work. The only difference are the url for LDAP and domain. I have tried everything from changing Windows Authentication Providers. I'm just curious if I need to add my machine as a trusted to the Active Directory which I'm not sure how. I have added the Active Directory User to the IIS with Full Control but still no luck.

Session with domain in codeigniter

I have a new project maintenance website (Codeigniter framework).
I downloaded source code from the server and set it up locally with domain bsd.test
I tried to login but failed. After I change domain locally to the same domain as the server, I login successfully.
How to config it so it runs with domain bsd.test in local?

(Codelgniter) Login page is not redirecting to source page in godaddy hosting server

I have used codeigniter to develop project.In Localhost it is working fine(Redirecting Also)But after hosting in godaddy Server if I login with correct details it is showing error.But in url it is showing domainame/controller.finally same login page is showing.
I Changed settings also according to server.
it is not Connecting to database even if i change database.php(host,username,password,database name)....and iam unable to getting users details from database

Resources