Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3320588
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:57:40+00:00 2026-05-17T22:57:40+00:00

How can Seam be configured to use different security-constraints for different web-resource-collections? In web.xml

  • 0

How can Seam be configured to use different security-constraints for different web-resource-collections?

In web.xml I included a sections like

<security-constraint>
    <web-resource-collection>
        <web-resource-name>AdminPages</web-resource-name>
        <url-pattern>/secure/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>admin</role-name>
    </auth-constraint>
</security-constraint>

<security-role>
    <role-name>admin</role-name>
</security-role>

If I omit the configuration above (web.xml). The user is authenticated (only password) using JAAS. I would prefer not write code for Authenticatin, I really only need to check that the user has the required role (admin).

In Seam this doesn’t work like expected. I receive HTTP-Errorcode 403 while trying to access the pages in /secure/*

I configured in components.xml This works when web.xml is not changed.

<security:identity jaas-config-name="admins" />

And jboss-web.xml

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

The question is where do I configure the role.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:57:40+00:00Added an answer on May 17, 2026 at 10:57 pm

    You have to set up a new security domain on JBoss.

    For instance:

    <policy>
        <application-policy name="testUsersRoles">
            <authentication>
                <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
                              flag="required">
                    <module-option name="usersProperties">usersb64.properties</module-option>
                    <module-option name="hashAlgorithm">MD5</module-option>
                    <module-option name="hashEncoding">base64</module-option>
                    <module-option name="unauthenticatedIdentity">nobody</module-option>
                </login-module>
            </authentication>
        </application-policy>
    </policy>
    

    (at the conf/login-config.xml file of your JBoss instance).

    You have more information here: Security on JBoss

    UPDATE:

    About the “use different security-constraints for different web-resource-collections” part of your question, you can set it adding a different “security-constraint” for every group of resources to control:

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>AdminPages</web-resource-name>
            <url-pattern>/secure/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>admin</role-name>
        </auth-constraint>
    </security-constraint>
    
    
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>CommonUserPages</web-resource-name>
            <url-pattern>/common/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>admin</role-name>
            <role-name>commonUser</role-name>
        </auth-constraint>
    </security-constraint>
    
    <security-role>
        <role-name>admin</role-name>
        <role-name>commonUser</role-name>
    </security-role>
    

    Please, note that both roles will be extracted by the asociated LoginModule at login time. So when your LoginModule authenticates an user, it retrieves the set of roles which this user belongs to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know if I can inject value from pages.xml into a Seam component?
I'm having a problem with my Seam code and I can't seem to figure
Can somebody point me to a resource that explains how to go about having
Can anyone tell me how I can display a status message like 12 seconds
Can I get a 'when to use' for these and others? <% %> <%#
Can somebody tell me how can I create an Seam project for Intellij IDEA?
I'm developing a web interface with seam/richfaces. Alot of the components has something akin
I want to use my message bundle (messages_fr.properties) in a Java class with seam.
Can I use the following across all browsers? <a href=# onclick=doSomething()>Click here.</a> Is this
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.