You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Laurent FALLET <la...@gmail.com> on 2005/07/05 08:36:43 UTC

Implementing my own realm

Hi everybody,
I'm planning to write my own realm, because the JDBCRealm doesn't suit
me very well. I would like to implement something else which only
needs 3 more lines.
The problem is that I don't know if I have to:
- add this new realm in Tomcat sources (create my own java file)
- then recompile all Tomcat
- and eventually use my new catalina.jar library into my running Tomcat
or
if it is possible to implement it outside the library and use it
either in it own jar file or directly in the webapp.

Any idea?
Tell me if I wasn't clear, or if you need details.
Regards,
Laurent

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


Re: Implementing my own realm

Posted by Jon Wingfield <jo...@mkodo.com>.
We've implemented our own realm. The step's are quite easy:

1) Implement your custom Realm, we subclassed RealmBase.
2) compile your Realm class with catalina.jar in the classpath
3) jar up your Realm class and any helper classes
4) deploy realm jar to server/lib

The only thing you really need to worry about is classloader issues: try 
to keep any references to your webapp classes out of the Realm and just 
deal with standard types like Principal otherwise you could end up 
deploying half your webapp classes to common/lib. Not good.

HTH,

Jon

Laurent FALLET wrote:
> Hi everybody,
> I'm planning to write my own realm, because the JDBCRealm doesn't suit
> me very well. I would like to implement something else which only
> needs 3 more lines.
> The problem is that I don't know if I have to:
> - add this new realm in Tomcat sources (create my own java file)
> - then recompile all Tomcat
> - and eventually use my new catalina.jar library into my running Tomcat
> or
> if it is possible to implement it outside the library and use it
> either in it own jar file or directly in the webapp.
> 
> Any idea?
> Tell me if I wasn't clear, or if you need details.
> Regards,
> Laurent
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



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