Hi guys, List of all possible roles is taken from default property file as a value of role_list property. hsr.isUserInRole(_) call checks whether current user has role to access this resource. If we talk about container-managed authentication in Java EE web application, then mappings between URLs and roles are specified in web.xml. In turn, mappings between users (groups) and roles are container-specific. It might be a property/xml file like jetty-login.properties or tomcat-users.xml (as far as I remember we decided not to add these files in repository, but they should have been attached to corresponding issue in JIRA) or web container might be configured to use an LDAP server. All neccessary configuration steps are described in blog entry.
So most probably the reason of this problem is that mapping between users and roles is not configured properly. Vladimir 2011/10/5 Richard Hirsch <[email protected]> > Thanks > > D. > > On Wed, Oct 5, 2011 at 10:45 AM, Ethan Jewett <[email protected]> wrote: > > Hi Dick, > > > > Maybe change rolesToCheck to something like: > > > > val rolesToCheck = Props.get("role_list") match { > > case Full(s) => { debug("The following roles were found in > > role_list: %s".format(s)) > > s.split(',').toList } > > case _ => { debug("No roles found in role_list.") > > Nil } > > } > > > > No idea if that will actually compile, but it looks more or less right. > > > > Cheers, > > Ethan > > > > On Tue, Oct 4, 2011 at 5:28 AM, Richard Hirsch <[email protected]> > wrote: > >> Hi, > >> > >> Right now, I'm trying to get container-based authentication to work > >> and I'm having a problem with the roles in UserAuth.scala. I know that > >> Vladimir is still on vacation but I thought someone else might be able > >> to help me. > >> > >> The code is here: > >> > >> val currentRoles = rolesToCheck.filter(hsr.isUserInRole(_)) > >> debug("User from HTTP Request: %s has following > >> roles=%s".format(username, currentRoles)) > >> if(currentRoles.size == 0) { > >> debug("No roles have been found") > >> S.error(S.?("base_user_err_unknown_creds")) > >> > >> The size of currentRoles is always 0 and I'm trying to trace why. > >> > >> How could I debug/trace all the values to rolesToCheck (line 290) ? > >> > >> Thanks > >> > >> D. > >> > > > -- Best Regards, Vladimir Ivanov
