users@glassfish.java.net

Re: Can login, but roles are not assigned

From: Harsha R A <Harsha.Ra_at_Sun.COM>
Date: Tue, 20 Nov 2007 17:33:47 +0530

Please check whether sun-web.xml is present in all the instances of the
clustered profile (in the domain-dir/generated/xml/j2ee-modules/<module
name>/WEB-INF directory).

Thanks
Harsha

glassfish_at_javadesktop.org wrote, On Tuesday 20 November 2007 05:01 PM:
> I have two setups configured identically. One is clustered with the cluster profile, the other is not clustered using the development profile. On the dev profile, everything is fine. On the cluster, user's can login but their roles are not assigned.
>
> Here's my setup:
>
> web.xml:
>
> <security-role>
> <role-name>admin</role-name>
> </security-role>
> <security-role>
> <role-name>member</role-name>
> </security-role>
>
> sun-web.xml:
>
> <security-role-mapping>
> <role-name>admin</role-name>
> <group-name>admin</group-name>
> </security-role-mapping>
> <security-role-mapping>
> <role-name>member</role-name>
> <group-name>member</group-name>
> </security-role-mapping>
>
> When logging in, the login is processed, but the user gets a 403 error when trying to access a resource that they should have access to.
>
> I know that the login is being processed because the user is forwarded onto the restricted resource they were requesting. If the login didn't process (bad credentials) the user is correctly shot off to the error logging in page.
>
> I see the following show up in the logs for each of the security roles defined in web.xml:
>
> Log Level: WARNING
> Logger: javax.enterprise.system.core.security
> Name-Value Pairs: _ThreadID=28;_ThreadName=RMI TCP Connection(1468)-216.147.203.239;_RequestID=44ea8886-a3c0-494f-8857-f9ae6cb4d207;
> Record Number: 4356
> Complete Message: No Principals mapped to Role [admin]
>
> Is there anything specific to JDBCRealm in a clustered environment? Why does an identical setup work with the development profile and not clustered? Why could the roles not be assigned despite the login processing successfully?
>
> Whe I first used glassfish I had this problem, but that was with the development profile and was easily solved by adding the security-role-mappings in sun-web.xml. Why are the security-role mappings in sun-web.xml ignored in a clustered environment?
> [Message sent by forum member 'rwillie6' (rwillie6)]
>
> http://forums.java.net/jive/thread.jspa?messageID=246287
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>