users@glassfish.java.net

Re: Security Roles

From: bfscom <bloggingfromscratch_at_gmail.com>
Date: Sun, 18 Jan 2009 18:55:57 -0800 (PST)

Here's my web.xml
<security-constraint>
        <web-resource-collection>
            <web-resource-name>Admin Pages</web-resource-name>
            <url-pattern>/view/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>

    
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All Pages</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>user</role-name>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>jdbc</realm-name>
        <form-login-config>
            <form-login-page>/login.jsp</form-login-page>
            <form-error-page>/login.jsp</form-error-page>
        </form-login-config>
    </login-config>

Here's my sun-web.xml
  <security-role-mapping>
    <role-name>user</role-name>
    <group-name>user</group-name>
  </security-role-mapping>
  <security-role-mapping>
    <role-name>admin</role-name>
    <group-name>admin</group-name>
  </security-role-mapping>



The security constraint is working too. I just can't get the roles

-- 
View this message in context: http://www.nabble.com/Security-Roles-tp21535982p21536183.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.