basic auth with database realm

Ja kub <[email protected]> Tue, 11 Mar 2014 20:28:47 +0100
Newsgroups gmane.comp.java.jboss.user
Message-ID <CAJqdOe-N95yPsoEsQb7M7QSKQzb0k7PLESXzPU30ckvc0VxU6A@mail.gmail.com>
--===============2234578407319100723==
Content-Type: multipart/alternative; boundary=001a11c15ff8a8ce1d04f459ba7c

--001a11c15ff8a8ce1d04f459ba7c
Content-Type: text/plain; charset=ISO-8859-1

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

--001a11c15ff8a8ce1d04f459ba7c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div><div>Could someone please send full st=
andalone.xml for eap 6.2, or it&#39;s vital parts.<br><br></div>I want to c=
onfigure basic web.xml auth with database realm, but I always finish with e=
rror.<br>
</div>Is there a difference in configuration between jboss 7.1 and jboss 7.=
3 and eap 6.2 ?<br><br></div>In &lt;subsystem xmlns=3D&quot;urn:jboss:domai=
n:security:1.2&quot;&gt;<br><br></div>I added <br><br>=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 &lt;security-domain name=3D&quot;mysqldomain&quot;=
 cache-type=3D&quot;default&quot;&gt;<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &lt;authenticatio=
n&gt;<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0 &lt;login-module code=3D&quot;Database&quot; flag=3D&quot;required&quot=
;&gt;<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0 &lt;module-option name=3D&quot;dsJndiName&quot; value=3D&qu=
ot;java:jboss/datasources/petclinicDS&quot;/&gt;<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 &lt;module-option name=3D&quot;principalsQuery&quot; value=3D&quot;s=
elect passwd from USERS where login=3D?&quot;/&gt;<br>=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &lt;module-opt=
ion name=3D&quot;rolesQuery&quot; value=3D&quot;select role &#39;Roles&#39;=
 from USER_ROLES where login=3D?&quot;/&gt;<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &lt;/=
login-module&gt;<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0 &lt;/authentication&gt;<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0 &lt;/security-domain&gt;<br><br>database java:jboss/datasources/petclin=
icDS is ok, it is used in petclinic app and works.<br>
<br></div><div>and in jboss-web.xml:<br><br>&lt;jboss-web&gt;<br>&lt;securi=
ty-domain&gt;java:/jaas/mysqldomain&lt;/security-domain&gt;<br>also tried w=
ith &lt;security-domain&gt;mysqldomain&lt;/security-domain&gt;<br>&lt;/jbos=
s-web&gt;<br>
<br></div><div>and in web.xml:<br><p>&lt;?xml version=3D&quot;1.0&quot; enc=
oding=3D&quot;UTF-8&quot;?&gt;</p><p>&lt;web-app xmlns=3D&quot;<a class=3D"=
" href=3D"http://java.sun.com/xml/ns/javaee" rel=3D"nofollow">http://java.s=
un.com/xml/ns/javaee</a>&quot; xmlns:xsi=3D&quot;<a class=3D"" href=3D"http=
://www.w3.org/2001/XMLSchema-instance" rel=3D"nofollow">http://www.w3.org/2=
001/XMLSchema-instance</a>&quot;</p>
<p>=A0=A0=A0 xsi:schemaLocation=3D&quot;<a class=3D"" href=3D"http://java.s=
un.com/xml/ns/javaee" rel=3D"nofollow">http://java.sun.com/xml/ns/javaee</a=
> <a class=3D"" href=3D"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" =
rel=3D"nofollow">http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd</a>&quot=
;</p>
<p>=A0=A0=A0 version=3D&quot;2.5&quot;&gt;</p><p>&lt;security-constraint&gt=
;</p><p>=A0=A0=A0 &lt;web-resource-collection&gt;</p><p>=A0=A0=A0=A0=A0=A0=
=A0 &lt;url-pattern&gt;/*&lt;/url-pattern&gt;</p><p>=A0=A0=A0 &lt;/web-reso=
urce-collection&gt;</p><p>=A0=A0=A0 &lt;auth-constraint&gt;</p>
<p>=A0=A0=A0=A0=A0=A0=A0 &lt;role-name&gt;Manager&lt;/role-name&gt;</p><p>=
=A0=A0=A0 &lt;/auth-constraint&gt;</p><p>&lt;/security-constraint&gt;</p><p=
>&lt;login-config&gt;</p><p>=A0=A0=A0 &lt;auth-method&gt;BASIC&lt;/auth-met=
hod&gt;</p><p>=A0=A0=A0 &lt;realm-name&gt;Sample Realm&lt;/realm-name&gt;</=
p>
<p>&lt;/login-config&gt;</p><p>&lt;security-role&gt;</p><p>=A0=A0=A0 &lt;ro=
le-name&gt;Manager&lt;/role-name&gt;</p><p>&lt;/security-role&gt;</p><p>&lt=
;/web-app&gt;</p>BR<br></div><div>Jakub<br></div></div>

--001a11c15ff8a8ce1d04f459ba7c--

--===============2234578407319100723==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user
--===============2234578407319100723==--