<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: IronJacamar Oracle Reauthentication support
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/peterfry">Peter Fry</a> in <i>IronJacamar Development</i> - <a href="https://community.jboss.org/message/833528#833528">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Is there a test case for this component. I am trying to support Oracle Proxy Authentication on EAP 6.0.1 but without any joy. My main stumbling block is the configuration of the security section of the datasource:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left"> <span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">subsystem</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">xmlns</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"urn:jboss:domain:datasources:1.1"</em></em><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;"> <span style="font-size: 2;"><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">xa-datasource</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">jndi-name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"java:jboss/datasources/someDS"</em></em><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">pool-name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"java:jboss/datasources/someDS_Pool"</em></em><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;"> </span></p></p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">datasources</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;"> </span></span></p><p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">xa-datasource-property</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"URL"</em></em><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;"> jdbc:oracle:thin:@%DATABASE_HOST%:%DATABASE_PORT%:%DATABASE_SID%<span style="font-size: 2;"><p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">xa-pool</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">is-same-rm-override</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;">false</span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">is-same-rm-override</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">no-tx-separate-pools</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;">true</span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">no-tx-separate-pools</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">xa-pool</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">security</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><p align="left"><p align="left"><div align="left"><span style="color: #3f5fbf; font-size: 10pt;"><div align="left"><span style="color: #3f5fbf; font-size: 10pt;">&lt;!--&lt;user-name&gt;USERNAME&lt;/user-name&gt;</span></div></span></div></p></p><span style="color: #3f5fbf; font-size: 10pt;"><p align="left">&lt;password&gt;PASSWORD&lt;/password&gt;</p><span style="color: #3f5fbf; font-size: 2;"><p align="left">&lt;reauth-<span style="text-decoration: underline;">plugin</span> class-name="org.me.OracleReauthPlugin"/&gt;--&gt;</p></span></span><p align="left"><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">security-domain</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;">demo</span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">security-domain</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span></p><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">security</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">validation</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">valid-connection-checker</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">class-name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"</em></em><span style="color: #008080; font-size: 10pt;">/&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">stale-connection-checker</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">class-name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"</em></em><span style="color: #008080; font-size: 10pt;">/&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">exception-sorter</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">class-name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"</em></em><span style="color: #008080; font-size: 10pt;">/&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">validation</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">xa-datasource</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">drivers</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">driver</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"oracle"</em></em><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">module</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"com.oracle"</em></em><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">xa-datasource-class</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;">oracle.jdbc.xa.client.OracleXADataSource</span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">xa-datasource-class</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">driver</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">drivers</span><span style="color: #008080; font-size: 10pt;">&gt;</span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">datasources</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span><span style="font-size: 10pt;"><span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">subsystem</span><span style="color: #008080; font-size: 10pt;">&gt;</span></span></p></span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">xa-datasource-property</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;"> <span style="font-size: 2;"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">driver</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 10pt;">oracle</span><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">driver</span><span style="color: #008080; font-size: 10pt;">&gt;</span><span style="font-size: 2;"> </span></span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have added a security domain</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;subsystem xmlns="urn:jboss:domain:security:1.2"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;security-domains&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;security-domain name="other" cache-type="default"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;login-module code="Remoting" flag="optional"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="password-stacking" value="useFirstPass"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;login-module code="RealmDirect" flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="password-stacking" value="useFirstPass"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/security-domain&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;security-domain name="jboss-web-policy" cache-type="default"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;authorization&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;policy-module code="Delegating" flag="required"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/authorization&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/security-domain&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;security-domain name="jboss-ejb-policy" cache-type="default"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;authorization&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;policy-module code="Delegating" flag="required"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/authorization&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/security-domain&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;security-domain name="brms" cache-type="default"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;login-module code="UsersRoles" flag="required"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="usersProperties" value="${jboss.server.config.dir}/brms-users.properties"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="rolesProperties" value="${jboss.server.config.dir}/brms-roles.properties"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/security-domain&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Introduced for demonstrating Oracle Proxy Authentication --&gt;<br/>&#160;&#160;&#160; &lt;security-domain name="demo" cache-type="default"&gt; <br/>&#160;&#160;&#160;&#160;&#160;&#160; &lt;authentication&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;login-module code="SimpleUsers" flag="sufficient"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="username" value="USERNAME"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="password" value="PASSWORD"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;login-module code="UsersRoles" flag="sufficient"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="usersProperties" value="${jboss.server.config.dir}/demo-users.properties"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;module-option name="rolesProperties" value="${jboss.server.config.dir}/demo-roles.properties"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/login-module&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160; &lt;/authentication&gt;<br/>&#160;&#160;&#160; &lt;/security-domain&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/> &lt;/security-domains&gt;<br/>&lt;/subsystem&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'm then running a arquillian test</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import java.security.PrivilegedAction;<br/>import java.sql.SQLException;<br/>import java.util.logging.Level;<br/>import java.util.logging.Logger;</p><p>import javax.ejb.EJB;<br/>import javax.security.auth.Subject;<br/>import javax.security.auth.login.LoginContext;<br/>import javax.security.auth.login.LoginException;</p><p>import org.jboss.arquillian.container.test.api.Deployment;<br/>import org.jboss.arquillian.junit.Arquillian;<br/>import org.jboss.arquillian.secureejb.JBossLoginContextFactory;<br/>import org.jboss.arquillian.secureejb.demo.SecurityRoles;<br/>import org.jboss.shrinkwrap.api.ShrinkWrap;<br/>import org.jboss.shrinkwrap.api.asset.EmptyAsset;<br/>import org.jboss.shrinkwrap.api.spec.WebArchive;<br/>import org.junit.Test;<br/>import org.junit.runner.RunWith;</p><p>import org.me.TestEjb; </p><p>@RunWith(Arquillian.class)<br/>public class OracleReauthPluginTest {</p><p> private static final Logger logger = Logger.getLogger(OracleReauthPluginTest.class.getName());<br/> <br/>&#160;&#160;&#160; @EJB<br/>&#160;&#160;&#160; private TestEjb testEjb;</p><p>&#160;&#160;&#160; @Deployment <br/>&#160;&#160;&#160; public static WebArchive createTestArchive() {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "test.war")<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .addClasses(JBossLoginContextFactory.class, SecurityRoles.class, TestEjb.class)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .addAsWebInfResource("META-INF/ejb-jar.xml").addAsWebInfResource("META-INF/jboss-ejb3.xml")<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource("users.properties")<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .addAsResource("roles.properties");<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return webArchive;<br/>&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; @Test<br/>&#160;&#160;&#160; public void testAuthorisedSecureOperation() throws LoginException {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; LoginContext loginContext = JBossLoginContextFactory.createLoginContext("user1", "password");<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; loginContext.login();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Subject.doAs(loginContext.getSubject(), new PrivilegedAction&lt;Void&gt;() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public Void run() {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {<br/>&#160;&#160;&#160;&#160; testEjb.performSecureOperation();<br/>&#160;&#160; } catch (SQLException e) {<br/>&#160;&#160;&#160;&#160; logger.log(Level.SEVERE, "EJB oepration failed", e);<br/>&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return null;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; } finally {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; loginContext.logout();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160; }<br/>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>With the logon context being supplied by</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>package org.jboss.arquillian.secureejb;</p><p>import java.io.IOException;<br/>import java.util.HashMap;<br/>import java.util.Map;</p><p>import javax.resource.spi.security.PasswordCredential;<br/>import javax.security.auth.Subject;<br/>import javax.security.auth.callback.Callback;<br/>import javax.security.auth.callback.CallbackHandler;<br/>import javax.security.auth.callback.NameCallback;<br/>import javax.security.auth.callback.PasswordCallback;<br/>import javax.security.auth.callback.UnsupportedCallbackException;<br/>import javax.security.auth.login.AppConfigurationEntry;<br/>import javax.security.auth.login.Configuration;<br/>import javax.security.auth.login.LoginContext;<br/>import javax.security.auth.login.LoginException;</p><p>/**<br/> * Provides a <a class="" href="https://community.jboss.org/mailto:{@link">{@link</a> LoginContext} for use by unit tests. It is driven by users.properties and roles.properties files as<br/> * described in &lt;a href="<a class="" href="https://community.jboss.org/wiki/UsersRolesLoginModule&amp;quot;&gt;UsersRolesLoginModule&lt;/a">https://community.jboss.org/wiki/UsersRolesLoginModule"&gt;UsersRolesLoginModule&lt;/a</a>&gt;<br/> */<br/>public class JBossLoginContextFactory {</p><p>&#160;&#160;&#160; static class NamePasswordCallbackHandler implements CallbackHandler {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private final String username;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private final String password;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private NamePasswordCallbackHandler(String username, String password) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.username = username;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.password = password;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (Callback current : callbacks) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (current instanceof NameCallback) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((NameCallback) current).setName(username);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else if (current instanceof PasswordCallback) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ((PasswordCallback) current).setPassword(password.toCharArray());<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } else {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new UnsupportedCallbackException(current);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; static class JBossJaasConfiguration extends Configuration {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private final String configurationName;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; JBossJaasConfiguration(String configurationName) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.configurationName = configurationName;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public AppConfigurationEntry[] getAppConfigurationEntry(String name) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!configurationName.equals(name)) {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new IllegalArgumentException("Unexpected configuration name '" + name + "'");<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return new AppConfigurationEntry[] {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; createUsersRolesLoginModuleConfigEntry(),</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; createClientLoginModuleConfigEntry(),</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; /**<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * The <a class="" href="https://community.jboss.org/mailto:{@link">{@link</a> org.jboss.security.auth.spi.UsersRolesLoginModule} creates the association between users and<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * roles.<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * @return<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private AppConfigurationEntry createUsersRolesLoginModuleConfigEntry() {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Map&lt;String, String&gt; options = new HashMap&lt;String, String&gt;();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return new AppConfigurationEntry("org.jboss.security.auth.spi.UsersRolesLoginModule",<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; /**<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * The <a class="" href="https://community.jboss.org/mailto:{@link">{@link</a> org.jboss.security.ClientLoginModule} associates the user credentials with the<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * <a class="" href="https://community.jboss.org/mailto:{@link">{@link</a> org.jboss.security.SecurityContext} where the JBoss security runtime can find it.<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * @return<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private AppConfigurationEntry createClientLoginModuleConfigEntry() {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Map&lt;String, String&gt; options = new HashMap&lt;String, String&gt;();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; options.put("multi-threaded", "true");<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; options.put("restore-login-identity", "true");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return new AppConfigurationEntry("org.jboss.security.ClientLoginModule",<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br/>&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; /**<br/>&#160;&#160;&#160;&#160; * Obtain a LoginContext configured for use with the ClientLoginModule.<br/>&#160;&#160;&#160;&#160; * <br/>&#160;&#160;&#160;&#160; * @return the configured LoginContext.<br/>&#160;&#160;&#160;&#160; */<br/>&#160;&#160;&#160; public static LoginContext createLoginContext(final String username, final String password) throws LoginException {<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; final String configurationName = "Arquillian Testing";</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; CallbackHandler cbh = new JBossLoginContextFactory.NamePasswordCallbackHandler(username, password);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Configuration config = new JBossJaasConfiguration(configurationName);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Subject subject = new Subject();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; PasswordCredential credential = new PasswordCredential(username,&#160; password.toCharArray());<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; subject.getPrivateCredentials().add(credential);<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return new LoginContext(configurationName, subject, cbh, config);<br/>&#160;&#160;&#160; }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The problem I have is that in BaseWrapperManagedConnectionFactory.SubjectActions.run() the subject has no private credentials.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Is the approach I'm taking (in terms of setting up an integration test) correct? I am hacking around with this.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/833528#833528">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in IronJacamar Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2099">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>