[jboss-user] [Security & JAAS/JBoss] - Re: Simple Auth for HelloWorld-Example not working...
j0llyr0g3r
do-not-reply at jboss.com
Tue Jun 24 11:21:16 EDT 2008
Hey folks,
my final remark how to achieve the same as above for an EAR:
== Securing access to the EJB-application ==
* Create the file users.properties under /$PROJECT-ROOT/META-INF:
admin=secretadminpassword
| user=secretuserpassword
* Create the file roles.properties under /$PROJECT-ROOT/META-INF:
| admin=adminRole
| user=userRole
* Add the following annotations to your beans:
@RolesAllowed("adminRole")
| public class SendCommandBean implements ISendCommandRemote, ISendCommandLocal {
|
| @RolesAllowed("adminRole")
| public String sendCommand(myArgs...) {
* Add the file jboss.xml to the ejb-subproject under the directory /META-INF
<jboss>
| <security-domain>java:/jaas/myDomain</security-domain>
| </jboss>
|
* Adjust the file login-config.xml under the directory $JBOSS_HOME/server/$PROFILE/conf/
<application-policy name = "myDomain">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
| <module-option
| name="usersProperties">
| META-INF/users.properties
| </module-option>
| <module-option
| name="rolesProperties">
| META-INF/roles.properties
| </module-option>
| </login-module>
| </authentication>
| </application-policy>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160272#4160272
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160272
More information about the jboss-user
mailing list