You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Ilya Platonov <re...@gmail.com> on 2006/03/25 04:47:27 UTC

Re: TomcatJAASRealm instead of TomcatGeronimoRealm

I spent a lot of time myself trying to change Realm, but didn't succeed.

On 3/24/06, Yeray Cabrera <ye...@integraas.com> wrote:
>
> Hi all,
>
> I have a problem with my custom security realm.
>
> I get deploy my web-app with my custom security-realm (including
> dependencies, ...). It work fine, but when in my code I run
> HttpServletRequest.isUserInRole("role"), always return false.
>
> I debugged my code ... userPrincipal had the correct name and subjects
> but roles is null (is a JAASTomcatPrincipal).
>
> Then, I debugged with geronimo source and I saw that my web-app used the
> org.apache.geronimo.tomcat.realm.TomcatGeronimoRealm and should use
> org.apache.geronimo.tomcat.realm.TomcatJAASRealm to assign  the roles to
> JAASTomcatPrincipal whit the subject, doesn't it?
>
> Looking for wiki I saw  http://wiki.apache.org/geronimo/Tomcat and I put
> this code in my geronimo-web.xml plan:
>
> ....
>     <container-config container="Tomcat">
>         <config-param
> name="TomcatJAASRealm">TomcatJAASRealm</config-param>
>     </container-config>
> ....
>     <gbean name="TomcatJAASRealm"
> class="org.apache.geronimo.tomcat.RealmGBean">
>         <attribute
> name="className">org.apache.geronimo.tomcat.realm.TomcatJAASRealm
> </attribute>
>         <attribute name="initParams">
>             userClassNames=com.ias.ibms.auth.IBMSUser
>             roleClassNames=com.ias.ibms.auth.IBMSRole
>         </attribute>
>     </gbean>
>
> But don't work :(
>
> Somebody Know how I can assign to use TomcatJAASRealm instead of
> TomcatGeronimoRealm
>
>     Thanks
>
>     Yeray Cabrera!
>