<!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="http://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;">
    Reauthentication
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/jesper.pedersen">Jesper Pedersen</a> in <i>IronJacamar Development</i> - <a href="http://community.jboss.org/docs/DOC-16434">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><h2>Description</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>A resource adapter can re-authenticate a physical connection (that is, one that already exists in the connection pool under a different security context) to the underlying EIS. A resource adapter performs reauthentication when an application server calls the <span style="font-family: andale mono,times;">getConnection</span> method with a security context, passed as a <span style="font-family: andale mono,times;">Subject </span>instance, different from the context previously associated with the physical connection.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2>Requirements</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li>Reauthentication support: The resource adapter provider must specify whether a resource adapter supports reauthentication of an existing physical connection.</li><li>The <span style="font-family: andale mono,times;">matchManagedConnections</span> method in <span style="font-family: andale mono,times;">ManagedConnectionFactory</span> may return a matched <span style="font-family: andale mono,times;">ManagedConnection</span> instance with the assumption that the <span style="font-family: andale mono,times;">ManagedConnection.getConnection</span> method will later switch the security context through reauthentication.</li><li>If reauthentication is successful, the resource adapter has changed the security context of the underlying <span style="font-family: andale mono,times;">ManagedConnection</span> instance to that associated with the passed <span style="font-family: andale mono,times;">Subject</span> instance.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Detailed description of the reauthentication process is described in section 9.1.9.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2>Design</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2>Implementation</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2>Test suite</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3>Test client</h3><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ol><li>Lookup connection factory / connection</li><li>Invoke connection with credential #1</li><li>Invoke connection with credential #2</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>should lead to success</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3>Resource adapter</h3><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li>Reauthentication enabled</li><li>Expose simple connection interface</li><li>Configuration: Initially &lt;min-pool-size&gt; and &lt;max-pool-size&gt; should be set to 1</li><li>Maybe do two resource adapters<ul><li>#1 using Subject</li><li>#2 using CRI</li></ul></li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h3>Target system</h3><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li>Allow a configured number of connections (java.net.Socket)<ul><li>Binary protocol</li><li>Command</li><li>Payload</li></ul></li><li>Support Subject based security through raw data</li><li>Support CRI based security through raw data</li><li>Support reauthentication on existing connection</li><li>Be able to run in-VM<ul><li>All communication has to go over the Sockets for clean separation between RA and EIS</li></ul></li></ul><h4>Code</h4><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The EIS is located under</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">org.jboss.jca.core.security.reauth.eis
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>And test cases under</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre ___default_attr="plain" class="jive_text_macro jive_macro_code"><p>org.jboss.jca.core.security.reauth.eis.unit</p></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h4>Protocol</h4><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Each command is identified with a byte followed by the payload for the command.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"><tbody><tr><th align="center" style="background-color: #6690bc;; border: 1px solid #000000;background-color: #6690bc;" valign="middle"><span style="color: #ffffff;"><strong>Command<br/></strong></span></th><th align="center" style="background-color: #6690bc;; border: 1px solid #000000;background-color: #6690bc;" valign="middle"><span style="color: #ffffff;"><strong>Input<br/></strong></span></th><th align="center" style="background-color: #6690bc;; border: 1px solid #000000;background-color: #6690bc;" valign="middle"><span style="color: #ffffff;"><strong>Output<br/></strong></span></th></tr><tr><td style="border: 1px solid #000000;">CONNECT</td><td style="border: 1px solid #000000;">&lt;nothing&gt;</td><td style="border: 1px solid #000000;">Boolean (True if granted access) (OBJECT)</td></tr><tr><td style="border: 1px solid #000000;">CLOSE</td><td style="border: 1px solid #000000;">&lt;nothing&gt;</td><td style="border: 1px solid #000000;">&lt;nothing&gt;</td></tr><tr><td style="border: 1px solid #000000;">ECHO</td><td style="border: 1px solid #000000;">Serializable (OBJECT)</td><td style="border: 1px solid #000000;">Serializable (Echo service) (OBJECT)</td></tr><tr><td style="border: 1px solid #000000;">AUTH</td><td style="border: 1px solid #000000;"><p>UserName (UTF)</p><p>Password (UTF)</p></td><td style="border: 1px solid #000000;">String (User name) (OBJECT)</td></tr><tr><td style="border: 1px solid #000000;">UNAUTH</td><td style="border: 1px solid #000000;">&lt;nothing&gt;</td><td style="border: 1px solid #000000;">Boolean (True if successful) (OBJECT)</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Option #C and #A described in section 9.1.9 should be tested in that order.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Ideally the entire test suite setup can be included as an example in the user guide.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2>JDBC</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Some databases support reauthentication, so we need to provide a way to enable support in our JDBC resource adapter.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We can also provide plugins for the Open Source databases that supports this.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h2>Links</h2><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li><a class="jive-link-external-small" href="http://jcp.org/en/jsr/detail?id=322">Java EE Connector Architecture 1.6</a></li><li><a class="jive-link-external-small" href="https://issues.jboss.org/browse/JBJCA-94">JBJCA-94</a></li><li><a class="" href="http://community.jboss.org/en/picketbox">PicketBox user forum</a></li><li><a class="" href="http://community.jboss.org/en/picketbox/dev">PicketBox developer forum</a></li><li><a class="jive-link-wiki-small" href="http://community.jboss.org/docs/DOC-10430">Old JCA pooling mechanims</a></li><li><a class="jive-link-message-small" href="http://community.jboss.org/message/230163#230163">User thread</a></li><li><a class="jive-link-external-small" href="https://issues.jboss.org/browse/JBAS-1429">JBAS-1429</a></li></ul></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-16434">going to Community</a></p>

        <p style="margin: 0;">Create a new document in IronJacamar Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2099">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>