You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Adrian Hall <ah...@mirapoint.com> on 2001/11/03 01:28:12 UTC

Realms - info/documentation?

Hi,

I am wanting to write a new security realm for a web application that I am currently developing.  I had hoped to use one of the standard realms to do this, but no dice.  Now, I would like information on the following:

How standard are realms?  Will my new realm class be importable into BEA or some other Application Server, for example?  (I have only used Tomcat, but want to allow other environments - Im an open sort of guy)

I wish to put something like the following in the config file:

    <Realm className="org.mps.realm.MiraRealm" Server="10.10.240.7" Base="domain" UserID="uid" />

I noticed that JDBC and JNDI realms (nice examples, btw) all have attributes - do I just have to include a setXXX (where XXX is my attribute in the XML statement) to get these attributes into my object?

Can I place my realm statement in my web applications web.xml document?  If so, can I place it inside the <web-app> directive, or do I need to place it outside (and before) the <web-app> directive?

Other than start(), stop() and authenticate(String, String), are there any other methods which I will generally need to implement?  I noticed getInfo() and getName() - are they required - if they are, is the format of the output fixed, or dynamic?

Thanks for the help in advance

Regards,

Adrian Hall

RE: Page not found

Posted by Ray Madigan <ra...@madigans.org>.
u need to add your application to server.xml in the conf directory.

-----Original Message-----
From: Daniel Kushner [mailto:daniel@websapp.com]
Sent: Friday, November 02, 2001 5:14 PM
To: Tomcat Users List
Subject: Page not found


Hi,

I got Tomcat setup. http://localhost:8080/index.html works fine and so does
/examples/. I created a directory named 'greeting' under the webapps
directory. In greeting there's an index.html file. When I go to
http://localhost:8080/greeting/index.html I get a page not error. Any ideas?

Thanks,
Daniel


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Page not found

Posted by Daniel Kushner <da...@websapp.com>.
Hi,

I got Tomcat setup. http://localhost:8080/index.html works fine and so does
/examples/. I created a directory named 'greeting' under the webapps
directory. In greeting there's an index.html file. When I go to
http://localhost:8080/greeting/index.html I get a page not error. Any ideas?

Thanks,
Daniel


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Realms - info/documentation?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 2 Nov 2001, Adrian Hall wrote:

> Date: Fri, 2 Nov 2001 16:28:12 -0800
> From: Adrian Hall <ah...@mirapoint.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: Realms - info/documentation?
>
> Hi,
>
> I am wanting to write a new security realm for a web application that
> I am currently developing.  I had hoped to use one of the standard
> realms to do this, but no dice.  Now, I would like information on the
> following:
>
> How standard are realms?  Will my new realm class be importable into
> BEA or some other Application Server, for example?  (I have only used
> Tomcat, but want to allow other environments - Im an open sort of guy)
>

Realms are totally specific to Tomcat.  In a J2EE 1.4 time frame (i.e. the
next major release) there is some work going on to standardize a service
provider interface for containers to connect to underlying security
infrastructures, but in the mean time each container is on their own.

(This effort is JSR 115.)

> I wish to put something like the following in the config file:
>
>     <Realm className="org.mps.realm.MiraRealm" Server="10.10.240.7"
>           Base="domain" UserID="uid" />
>
> I noticed that JDBC and JNDI realms (nice examples, btw) all have
> attributes - do I just have to include a setXXX (where XXX is my
> attribute in the XML statement) to get these attributes into my
> object?
>

The code that processes server.xml uses Java reflection to match up
attribute names to corresponding property setters.  For example, an
attribute named "server" would be mapped to a corresponding "getServer()"
method call.

Note - you should really use lower case property names to make this work.

> Can I place my realm statement in my web applications web.xml
> document?  If so, can I place it inside the <web-app> directive, or do
> I need to place it outside (and before) the <web-app> directive?
>

No -- this goes in server.xml.  See the configuration docs for more info.

> Other than start(), stop() and authenticate(String, String), are there
> any other methods which I will generally need to implement?  I noticed
> getInfo() and getName() - are they required - if they are, is the
> format of the output fixed, or dynamic?
>

The only things that are required are those listed in the
org.apache.catalina.Realm interface.

Conventionally, most of the modules have a "debug" property, but that's up
to you.

> Thanks for the help in advance
>
> Regards,
>
> Adrian Hall
>

Craig



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>