tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabe Wong <gabri...@ngasi.com>
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.security.Principal;
import java.sql.*;
import java.util.*;
import java.io.*;

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.

-- 
Regards

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


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message