问题描述
我有这个问题,我只是无法找到解决方案.
I have this problem and i just cannot find a solution to it.
我正在使用JBoss AS 7,并使用Eclipse Indigo创建了一个动态Web项目.从我的项目中,我创建了一个简单的登录表单,在正确登录后,应将其定向到相应的部分.
I am using JBoss AS 7 and created a dynamic web project using Eclipse Indigo. From my project i created a simple login form whereby after correctly logging in i should be directed to my appropriate section.
用户,角色和组应由jboss而非项目管理.因此,jboss应在签入正确的属性文件后决定将我重定向到何处.
Users, Roles and Groups should be managed by jboss and not the project. So jboss should decide where to redirect me after checking in the correct properties files.
我该怎么做?大家可以帮我吗?
How can i do this? Can you all help me please.
推荐答案
好,我终于明白了.三个简单的步骤即可完成.
Well i finally got it. Three simple steps to follow.
-
在web.xml文件中,根据角色放置所有安全约束.
In the web.xml file, put all your security constraints according to the roles.
验证 任何名字 * .jsf 得到 邮政 行政 没有
Authentication any name *.jsf GET POST admin NONE
登录配置
形式 领域名称 /mylogin.jsf /myerror.jsf
FORM realm name /mylogin.jsf /myerror.jsf
安全角色
描述 行政
desc admin
在WEB-INF文件夹中创建一个jboss-web.xml文件.在该文件内,写
Create a jboss-web.xml file in the WEB-INF folder. Inside this file, write
<jboss-web>
<security-domain>java:/jaas/realmname</security-domain>
</jboss-web>
在WEB-INF文件夹中创建一个文件夹类,并将其中的user.properties和role.properties文件放置在其中.
Create a folder classes in the WEB-INF folder and place your user.properties and role.properties file in it.
然后最后一步是将配置添加到standalone.xml文件中
And then the final step is to add the configuration in the standalone.xml file
<security-domain name="realmname">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
<module-option name="usersProperties" value="users.properties"/>
<module-option name="rolesProperties" value="roles.properties"/>
</login-module>
</authentication>
</security-domain>
这篇关于Jboss登录并重定向到正确的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!