问题
I've configured JAAS in glassfish 3.0 and used JDBCRealm for authenticating users. It's working properly and URL(s) are restricted. But the method
#{facesContext.externalContext.isUserInRole('admin')}
always returns false, even when the logged in user is admin.I've set "admin" for both "group name" in my database and for "role name" in the mapping file and the user is admin. What might be the problem?
回答1:
In a servlet container, isUserInRole is just a call to the underlying servlet method. I would double-check the role mappings in the deployment descriptor.
来源:https://stackoverflow.com/questions/5648562/is-isuserinrole-method-related-to-jaas