4 Replies Latest reply: Aug 9, 2013 5:56 AM by hantsy bai RSS

JAAS for JBoss 7 -Properties based configuration.

hantsy bai Master

I tried to user UsersRoles code, and related the configuration is the following.

 

 

 <security-domain name="other" cache-type="default">
                    <authentication>
                        <login-module code="UsersRoles" flag="required">
                            <module-option name="usersProperties" value="users.properties"/>
                            <module-option name="rolesProperties" value="roles.properties"/>
                        </login-module>
                    </authentication>
                </security-domain>

 

 

And added the users.properties and roles.properties in JBoss 7 standalone/configuration folder.

 

users.properties

 

admin=admin
user=user

 

roles.properties

 

user=ROLE_VIEWER
admin=ROLE_ADMINISTRATOR
user.Roles=ROLE_VIEWER
admin.Roles=ROLE_ADMINISTRATOR

 

And configuration in project jboss-web.xml

 

<jboss-web>
    <security-domain>java:/jaas/other</security-domain>
</jboss-web>     

 

When I tried to login, jboss reported it can not find the users.properties or defaultUsers.properties.

 

I tried to find some info in the JBoss 7 documentation, and it is too simple, I can not find positvie help there.

 

How to fix it? Thanks.