You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Janne Ruuttunen <ja...@oikeatoliot.fi> on 2003/03/28 14:45:58 UTC

SSL client auth -> Realms

Hello all.

I'm running tomcat-4.1.42-LE-jdk14 on linux, using SSL with client
authentication, and a web app that has an additional form-based regular JDBC
Realm authentication with a username and a password. I would like to remove
this extra authentication step, and just use the client certificate with
some mapping to the actual user names. How should I map valid SSL client
certificates to regular realm-based authentication?
Currently I'm thinking whether it's possible to add my own Valve that would
do it (after the CertificatesValve has exposed the client certificate)
through the user database or JNDI or something, but don't know how to
proceed.

Thanks in advance for any insight.

Janne Ruuttunen


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: SSL client auth -> Realms

Posted by Bill Barker <wb...@wilshire.com>.
It would be much easier to just replace and/or extend the JDBCRealm with
your own custom Realm, then trying to jump through the hoops to get a Valve
working.  If you must go the Valve route, then look at
o.a.c.authenticator.SingleSignOn to see what to do.

Assuming that you want to go with the Realm idea.  You need to change your
web.xml's auth-method from FORM to CLIENT-CERT (assuming that you only want
to allow logins with certs).  Also remove the form-login-config section.

In your custom Realm, you will probably want to override the method:
    public Principal authenticate(X509Certificate certs[]);
to handle authenticating the user.  As in the Servlet-Spec, certs[0] is the
user's cert, and the rest are the signers in order.  If you are writing your
Realm from scratch, then this is the only way to go.  If you are extending
RealmBase (e.g. you extend JDBCRealm), then you could alternatively override
the method:
    protected  Principal getPrincipal(String username);
The 'username' will be the cert's Subject.  This is how MemoryRealm deals
with CLIENT-CERT authentication.

"Janne Ruuttunen" <ja...@oikeatoliot.fi> wrote in message
news:006801c2f530$5d657240$db7664c2@JANNENKONE...
> Hello all.
>
> I'm running tomcat-4.1.42-LE-jdk14 on linux, using SSL with client
> authentication, and a web app that has an additional form-based regular
JDBC
> Realm authentication with a username and a password. I would like to
remove
> this extra authentication step, and just use the client certificate with
> some mapping to the actual user names. How should I map valid SSL client
> certificates to regular realm-based authentication?
> Currently I'm thinking whether it's possible to add my own Valve that
would
> do it (after the CertificatesValve has exposed the client certificate)
> through the user database or JNDI or something, but don't know how to
> proceed.
>
> Thanks in advance for any insight.
>
> Janne Ruuttunen




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org