Why doesn't JBOSS authenticate by DIGEST method?

925 views Asked by At

I successfully logged-in by BASIC method authentication, I want to change my authentication method from BASIC to DIGEST. but I get this exception:

18:34:37,958 ERROR [org.jboss.security.authentication.JBossCachedAuthenticationManager] (http-localhost-127.0.0.1-8080-1) Login failure: javax.security.auth.login.LoginException: Security Exception

I use JBOSS 7 AS standalone and here are my configuration files: (Of course, I've excluded some irrelevant lines)

jboss-web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <security-domain>java:/jaas/digest</security-domain>
</jboss-web>

web.xml:

<security-constraint>
    <display-name>admin resources</display-name>
    <web-resource-collection>
        <web-resource-name>admin</web-resource-name>
        <description />
        <url-pattern>/*</url-pattern>
        <http-method>GET</http-method>
        <http-method>PUT</http-method>
        <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
        <description />
        <role-name>admin</role-name>
    </auth-constraint>
</security-constraint>
<security-role>
    <description>All admins</description>
    <role-name>admin</role-name>
</security-role>
<login-config>
    <auth-method>DIGEST</auth-method>
    <realm-name>ApplicationRealm</realm-name>
</login-config>

standalone.xml:

    <security-domains>
        <security-domain name="digest" cache-type="default">
            <authentication>
                <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
                    <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
                    <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
                    <module-option name="realm" value="ApplicationRealm"/>
                    <module-option name="hashAlgorithm" value="MD5"/>
                    <module-option name="hashEncoding" value="rfc2617"/>
                    <module-option name="hashUserPassword" value="false"/>
                    <module-option name="hashStorePassword" value="true"/>
                    <module-option name="passwordIsA1Hash" value="true"/>
                    <module-option name="storeDigestCallback" value="org.jboss.security.auth.spi.RFC2617Digest"/>
                </login-module>
            </authentication>
        </security-domain>
        <security-domain name="other" cache-type="default">
            <authentication>
                <login-module code="Remoting" flag="optional">
                    <module-option name="password-stacking" value="useFirstPass"/>
                </login-module>
                <login-module code="RealmUsersRoles" flag="required">
                    <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>
                    <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>
                    <module-option name="realm" value="ApplicationRealm"/>
                    <module-option name="password-stacking" value="useFirstPass"/>
                </login-module>
            </authentication>
        </security-domain>

application-users.properties:

mostafasho=c3535bbe0db83e64d424b47c1e9b7a2c

application-roles.properties:

mostafasho=admin

Am I missing something?

0

There are 0 answers