Custom error page when tomcat authentication fails


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Custom error page when tomcat authentication fails
# 1  
Old 05-06-2008
Custom error page when tomcat authentication fails

Hi people, i have this problem trying to get a custom error page when client authentication fails:

I had configured successfully my tomcat with client authentication using certificates, and now I would like to redirect the user to a custom error page when authentication fails, but I always get a 400 not found error if this happens.

I already tried to set my error page for 400 error code in web.xml but I can't get it to work.
Shouldn't be 403 (forbidden) the error when authentication fails?
Somewhere I read that the socket connection is terminated by tomcat before i can send the user anywhere, and thats why i don't get the redirection.

Here is part of my web.xml... Any idea?
(I entered some blank spaces to be able to show the xml tags)
Thanks in advance.

<login-config>
<auth-method>CLIENT-CERT</auth-method>
<realm-name>certificate</realm-name>
</login-config>

<error-page>
<error-code>400</error-code>
<location>/static/html/errorcert.html</location>
</error-page>

PH: I also tried the error-page tag in the login-config section with the same results.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Insmod custom module fails with message : disagrees about version of symbol ...

Hello : I want to make a netfilter conntrack module for myself. So I copy all the source code about netfilter conntrack from kernel source tree to my external directory. It can be insmod after compiled. Then I add some members to the struct nf_conn, and it 's compiled successfully. However, it... (1 Reply)
Discussion started by: 915086731
1 Replies

2. UNIX and Linux Applications

Tomcat 6.0 fails to read symlink(symbolic link) file

Hello all experts, Im in a situation where Tomcat simply does not want to read this file through the symlink.... I checked permissions..OK Also checked file & tomcat owner...all OK. This is what I have my /tomcat/conf/Catalina/local/appname.xml <Context> <Resource name="jdbc/black" ... (3 Replies)
Discussion started by: KingaKoopa
3 Replies

3. Solaris

Tomcat..Unable to deploy application remotely in tomcat

Hi, We have upgrade tomcat from 5.0.20 to 7.0.33 and made changes to server.xml file according to newer version.. how ever the upgrade went fine and now i am unable to deploy application remotely.. it is giving 403 access denied error.. we have seperate appbase directory mentioned in server.xml..... (0 Replies)
Discussion started by: phani4u
0 Replies

4. Ubuntu

Passwordless ssh authentication fails

Unable to set ssh passwordless authentication I am unable to ssh with passwordless authentication from Windows client onto UBuntu server. The ssh version on UBuntu is OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e , while SSH on Windows Client is OpenSSH_5.1p1, OpenSSL 0.9.8k. I turned on ssh... (5 Replies)
Discussion started by: tkota
5 Replies

5. Web Development

Tomcat - Error Logs

Hi Gurus, Our tomcat server was found hanging and responding to requests although ports 8080 & 8009(AJP) were found in listening state. The catalina.out had the below output: We have JavaMelody(Monitoring tool) packaged along with our application and it seems that monitoring through... (3 Replies)
Discussion started by: Hari_Ganesh
3 Replies

6. Shell Programming and Scripting

[Solved] While tomcat shutting down getting error

While tomcat shutting down getting the below error. Error occurred during initialization of VM Could not reserve enough space for code cache CATALINA_OPTS="-verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:MaxPermSize=24M -Xms256M -Xmx512M -Djava.awt.headless=true -XX:-UseCompressedOops... (2 Replies)
Discussion started by: tuxslonik
2 Replies

7. Web Development

Tomcat shutdown error

not sure if this is the right forum but im having problem with tomcat restart. i have a regular user that when he login it will go directly to a menu options (a. stop tomcat, start tomcat,). if he selects start it would should show that tomcat has been restarted. if the user press X, he will... (2 Replies)
Discussion started by: lhareigh890
2 Replies

8. Solaris

Tomcat Error-HTTP Status code 500

when I typed path http://localhost:8080/MyFirst/HelloWorld in web-browser ,it came up with error HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception ... (0 Replies)
Discussion started by: srinivas2828
0 Replies

9. UNIX for Dummies Questions & Answers

Creating Custom man Page in Solaris

Hello experts, I'm creating a custom man page. I have two unix boxes - one Hp & the other Solaris On HP, I simply moved the .Z file to /usr/man/man7.Z/ and after that "man myPage" worked. I then tried to do the same on Solaris. First thing is the relevant directory seemed to be... (1 Reply)
Discussion started by: sridhar_423
1 Replies

10. UNIX for Advanced & Expert Users

Error Tomcat + Apache

Hi, I have a machine with Unixware 7.1.3 and Apache 2 and Tomcat 4.0.3 it's works, but in the archive log from mod_jk.log ajp13_process_callback - write failed : Error ajp13_process_callback - write failed : Error ajp13_process_callback - write failed : Error... (1 Reply)
Discussion started by: By_Jam
1 Replies
Login or Register to Ask a Question
pam_authenticate(3PAM)													    pam_authenticate(3PAM)

NAME
pam_authenticate - perform authentication within the PAM framework SYNOPSIS
cc [ flag ... ] file ... -lpam [ library ... ] #include <security/pam_appl.h> int pam_authenticate(pam_handle_t *pamh, int flags); The pam_authenticate() function is called to authenticate the current user. The user is usually required to enter a password or similar authentication token depending upon the authentication service configured within the system. The user in question should have been speci- fied by a prior call to pam_start() or pam_set_item(). The following flags may be set in the flags field: PAM_SILENT Authentication service should not generate any messages. PAM_DISALLOW_NULL_AUTHTOK The authentication service should return PAM_AUTH_ERR if the user has a null authentication token. Upon successful completion, PAM_SUCCESS is returned. In addition to the error return values described in pam(3PAM), the following values may be returned: PAM_AUTH_ERR Authentication failure. PAM_CRED_INSUFFICIENT Cannot access authentication data due to insufficient credentials. PAM_AUTHINFO_UNAVAIL Underlying authentication service cannot retrieve authentication information. PAM_USER_UNKNOWN User not known to the underlying authentication module. PAM_MAXTRIES An authentication service has maintained a retry count which has been reached. No further retries should be attempted. See attributes(5) for description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability | Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe with exceptions | +-----------------------------+-----------------------------+ pam(3PAM), pam_open_session(3PAM), pam_set_item(3PAM), pam_setcred(3PAM), pam_start(3PAM), libpam(3LIB), attributes(5) In the case of authentication failures due to an incorrect username or password, it is the responsibility of the application to retry pam_authenticate() and to maintain the retry count. An authentication service module may implement an internal retry count and return an error PAM_MAXTRIES if the module does not want the application to retry. If the PAM framework cannot load the authentication module, then it will return PAM_ABORT. This indicates a serious failure, and the application should not attempt to retry the authentication. For security reasons, the location of authentication failures is hidden from the user. Thus, if several authentication services are stacked and a single service fails, pam_authenticate() requires that the user re-authenticate each of the services. A null authentication token in the authentication database will result in successful authentication unless PAM_DISALLOW_NULL_AUTHTOK was specified. In such cases, there will be no prompt to the user to enter an authentication token. The interfaces in libpam are MT-Safe only if each thread within the multithreaded application uses its own PAM handle. 27 Jan 2005 pam_authenticate(3PAM)