<!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;">
    Undertow - IdentityManager
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/dlofthouse">Darran Lofthouse</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/docs/DOC-48628">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><h1>Undertow - Identity Manager</h1><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The purpose of this article is to describe the current IdentityManager interface used by Undertow and to become the base for discussions relating to additional capabilities required.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java"><font color="navy"><b>public</b></font> <font color="navy"><b>interface</b></font> IdentityManager <font color="navy">{</font>
&#160;
&#160;
&#160;&#160;&#160; <font color="darkgreen">/**
&#160;&#160;&#160;&#160; * Verify a previously authenticated account.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * Typical checks could be along the lines of verifying that the account is not now locked or that the password has not been
&#160;&#160;&#160;&#160; * reset since last verified, also this provides an opportunity for roles to be re-loaded if membership information has
&#160;&#160;&#160;&#160; * changed.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * @param account - The {@link Account} to verify.
&#160;&#160;&#160;&#160; * @return An updates {@link Account} if verification is successful, null otherwise.
&#160;&#160;&#160;&#160; */</font>
&#160;&#160;&#160; Account verify(<font color="navy"><b>final</b></font> Account account);
&#160;
&#160;
&#160;&#160;&#160; <font color="darkgreen">// TODO Realm / Partitioning information could be specified.</font>
&#160;
&#160;
&#160;&#160;&#160; <font color="darkgreen">/**
&#160;&#160;&#160;&#160; * Verify a supplied {@link Credential} against a requested ID.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * @param id - The requested ID for the account.
&#160;&#160;&#160;&#160; * @param credential - The {@link Credential} to verify.
&#160;&#160;&#160;&#160; * @return The {@link Account} for the user if verification was successful, null otherwise.
&#160;&#160;&#160;&#160; */</font>
&#160;&#160;&#160; Account verify(<font color="navy"><b>final</b></font> String id, <font color="navy"><b>final</b></font> Credential credential);
&#160;
&#160;
&#160;&#160;&#160; <font color="darkgreen">/**
&#160;&#160;&#160;&#160; * Perform verification when all we have is the Credential, in this case the IdentityManager is also responsible for mapping the Credential to an account.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * The most common scenario for this would be mapping an X509Certificate to the user it is associated with.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * @param credential
&#160;&#160;&#160;&#160; * @return
&#160;&#160;&#160;&#160; */</font>
&#160;&#160;&#160; Account verify(<font color="navy"><b>final</b></font> Credential credential);
&#160;
&#160;
&#160;&#160;&#160; <font color="darkgreen">/**
&#160;&#160;&#160;&#160; * A temporary method for the Digest mechanism.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * @param id
&#160;&#160;&#160;&#160; * @return
&#160;&#160;&#160;&#160; */</font>
&#160;&#160;&#160; Account getAccount(<font color="navy"><b>final</b></font> String id);
&#160;
&#160;
&#160;&#160;&#160; <font color="darkgreen">/**
&#160;&#160;&#160;&#160; * Return the password for an account. This is an optional method, as is only used for digest auth where the original
&#160;&#160;&#160;&#160; * password is needed to compute the digest.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * This is an optional method. It is recommended that passwords be stored in a hashed format, so for most identity managers
&#160;&#160;&#160;&#160; * it will not be possible nor desirable to implement this method.
&#160;&#160;&#160;&#160; *
&#160;&#160;&#160;&#160; * @param account the account
&#160;&#160;&#160;&#160; * @return The accounts password
&#160;&#160;&#160;&#160; */</font>
&#160;&#160;&#160; <font color="navy"><b>char</b></font>[] getPassword(<font color="navy"><b>final</b></font> Account account);
&#160;
&#160;
&#160;&#160;&#160; <font color="darkgreen">/**
&#160;&#160;&#160;&#160; * Return the pre-prepared hash for the account.
&#160;&#160;&#160;&#160; * @param account - The account the hash is required for.
&#160;&#160;&#160;&#160; * @return The pre-prepared MD5 hash.
&#160;&#160;&#160;&#160; */</font>
&#160;&#160;&#160; <font color="navy"><b>byte</b></font>[] getHash(<font color="navy"><b>final</b></font> Account account);
&#160;
&#160;
<font color="navy">}</font>
</code></pre></div>

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

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


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

</div>

</body>
</html>