JBoss Community

BASIC Authentication in AS7

created by c go in JBoss AS7 Development - View the full discussion

I'm running in some troubles using Basic Authentication in AS7 to secure the access to a simple test servlet.

Standard error message is:

[org.jboss.security.auth.spi.UsersRolesLoginModule] (http-localhost.localdomain-127.0.0.1-8080-1) Failed to load users/passwords/role files: java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found

 

Specifying the users.properties & roles.properties files in standalone.xml causes the same error:

[org.jboss.security.auth.spi.UsersRolesLoginModule] (http-localhost.localdomain-127.0.0.1-8080-1) Failed to load users/passwords/role files: java.io.IOException: No properties file: /absolute/path/to/users.properties or defaults: defaultUsers.properties found

 

The application's jboss-web.xml file looks like this:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE jboss-web
    PUBLIC -//JBoss//DTD Web Application 2.3V2//EN
    http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd>

<jboss-web>
    <security-domain>other</security-domain>
</jboss-web>

 

The servlet security is defined like this (web.xml):

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All resources</web-resource-name>
            <description>Protects all resources</description>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>

        <auth-constraint>
            <role-name>role</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>Test Realm</realm-name>
    </login-config>

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

 

Is there anything obvious that I could be missing?

 

P.S.: Sorry for my English

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community