I am using authority groups and once the user is logged in I need to do different things depending what group the user is in (there are a number of hard coded groups).
I cannot see anyway to get this information from the Authentication object retrieved by :
Authentication auth = SecurityContextHolder.getContext().getAuthenticati on();
I have the following defined in the applicationContext-security.xml. I can possibly get the group from the JdbcUserDetailsManager but I see no way to access that from java.
<authentication-manager alias="authenticationManager">
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
group-authorities-by-username-query="..."
users-by-username-query="..."
authorities-by-username-query="..."/>
</authentication-provider>
</authentication-manager>
<beans:bean id="userDetailsManager" class="org.springframework.security.provisioning.J dbcUserDetailsManager">
<beansroperty name="dataSource" ref="dataSource"/>
<beansroperty name="authenticationManager" ref="authenticationManager"/>
<!-- enable lookup of permissions via user's group -->
<beansroperty name="enableGroups" value="true"/>
<!-- disable direct lookup of user's permissions (require lookup via group) -->
<beansroperty name="enableAuthorities" value="false"/>
</beans:bean>


roperty name="dataSource" ref="dataSource"/>
