[jboss-user] basic auth with database realm

Ja kub jjakub83 at gmail.com
Tue Mar 11 15:28:47 EDT 2014


Could someone please send full standalone.xml for eap 6.2, or it's vital
parts.

I want to configure basic web.xml auth with database realm, but I always
finish with error.
Is there a difference in configuration between jboss 7.1 and jboss 7.3 and
eap 6.2 ?

In <subsystem xmlns="urn:jboss:domain:security:1.2">

I added

                <security-domain name="mysqldomain" cache-type="default">
                    <authentication>
                        <login-module code="Database" flag="required">
                            <module-option name="dsJndiName"
value="java:jboss/datasources/petclinicDS"/>
                            <module-option name="principalsQuery"
value="select passwd from USERS where login=?"/>
                            <module-option name="rolesQuery" value="select
role 'Roles' from USER_ROLES where login=?"/>
                        </login-module>
                    </authentication>
                </security-domain>

database java:jboss/datasources/petclinicDS is ok, it is used in petclinic
app and works.

and in jboss-web.xml:

<jboss-web>
<security-domain>java:/jaas/mysqldomain</security-domain>
also tried with <security-domain>mysqldomain</security-domain>
</jboss-web>

and in web.xml:

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

    version="2.5">

<security-constraint>

    <web-resource-collection>

        <url-pattern>/*</url-pattern>

    </web-resource-collection>

    <auth-constraint>

        <role-name>Manager</role-name>

    </auth-constraint>

</security-constraint>

<login-config>

    <auth-method>BASIC</auth-method>

    <realm-name>Sample Realm</realm-name>

</login-config>

<security-role>

    <role-name>Manager</role-name>

</security-role>

</web-app>
BR
Jakub
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20140311/b4e3bc3b/attachment.html 


More information about the jboss-user mailing list