开发者

Glassfish not loading secure page

开发者 https://www.devze.com 2023-02-17 21:39 出处:网络
I\'ve made a basic login on my Glassfish s开发者_StackOverflow中文版erver, when I try it the username and password is recognised and accepted but nothing is loaded, the browser seems to attempt to loa

I've made a basic login on my Glassfish s开发者_StackOverflow中文版erver, when I try it the username and password is recognised and accepted but nothing is loaded, the browser seems to attempt to load something but instead just sits on the initial page.

I have made an account in file realm and the login is successfully recognised.

The link which brings up the login is: <a href="secureUser/secret.xhtml">

In web.xml I have this:

<security-constraint>
        <display-name>UserConstraint</display-name>
        <web-resource-collection>
            <web-resource-name>User</web-resource-name>
            <description/>
            <url-pattern>/secureUser/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <description/>
            <role-name>user</role-name>
        </auth-constraint>
</security-constraint>
<login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>file</realm-name>
</login-config>
<security-role>
        <description/>
        <role-name>user</role-name>
</security-role>

Any ideas as to why it doesn't load secret.xhtml?

Thanks!


Have you added a security-role-mapping in your sun-web.xml, such like this:

<security-role-mapping>
    <role-name>user</role-name>
    <principal-name>admin</principal-name>
</security-role-mapping>

Replace the content of <principal-name> with the user name of your file realm.

If this doesn't help: You can change the logging of glassfish's security module. Change the log level of the javax.enterprise.system.core.security module to FINEST in the admin console.

Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消