tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabe Wong <>
Subject Re: Question about Tomcat/IIS and NTLM authentication
Date Mon, 21 Jan 2008 20:49:39 GMT
Mark Thomas wrote:
> eborisow wrote:
>> If someone has been able to get this working and could provide some 
>> help,
>> that would be great.
> Haven't tried it but you should be able to create a custom Realm by 
> extending the existing JNDIRealm and manipulating the user name, 
> probably by overriding the authenticate() methods.
The specific code my look like so:

import org.apache.catalina.realm.*;
import java.sql.*;
import java.util.*;

public class CustomTomcatRealm
    extends JDBCRealm {
public synchronized Principal authenticate(String username, String 
credentials) {
                   Principal p = super.authenticate(username,credentials);
                if (p != null){
                   String newName = //whatever;
                    ArrayList roles = getRoles(newName);
           p = new GenericPrincipal(this, newName, credentials, roles);
return p;


Check the syntax as it was just done on the fly.


Gabe Wong
NGASI AppServer Manager
JAVA AUTOMATION and SaaS Enablement
<a href=></a>
NEW! 8.0 - Centrally manage multiple physical servers

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message