UserRolesLoginModule example
Example 12.5. UserRolesLoginModule ejb3-sampleapp-users.properties ejb3-sampleapp-roles.properties In Example 12.5, “UserRolesLoginModule”, the ejb3-sampleapp-users.properties file uses a username=password format with each user entry on a separate line: username1=password1 username2=password2 ... The ejb3-sampleapp-roles.properties file referenced in Example 12.5, “UserRolesLoginModule” uses the pattern username=role1,role2, with an optional group name value. For example: username1=role1,role2,... username1.RoleGroup1=role3,role4,... username2=role1,role3,... The user name.XXX property name pattern present in ejb3-sampleapp-roles.properties is used to assign the user name roles to a particular named group of roles where the XXX portion of the property name is the group name. The user name=... form is an abbreviation for user name.Roles=..., where the Roles group name is the standard name the JaasSecurityManager expects to contain the roles which define the users permissions. The following would be equivalent definitions for the jduke user name: jduke=TheDuke,AnimatedCharacter jduke.Roles=TheDuke,AnimatedCharacter