<!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;"> </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;"> </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>
 
 
    <font color="darkgreen">/**
     * Verify a previously authenticated account.
     *
     * Typical checks could be along the lines of verifying that the account is not now locked or that the password has not been
     * reset since last verified, also this provides an opportunity for roles to be re-loaded if membership information has
     * changed.
     *
     * @param account - The {@link Account} to verify.
     * @return An updates {@link Account} if verification is successful, null otherwise.
     */</font>
    Account verify(<font color="navy"><b>final</b></font> Account account);
 
 
    <font color="darkgreen">// TODO Realm / Partitioning information could be specified.</font>
 
 
    <font color="darkgreen">/**
     * Verify a supplied {@link Credential} against a requested ID.
     *
     * @param id - The requested ID for the account.
     * @param credential - The {@link Credential} to verify.
     * @return The {@link Account} for the user if verification was successful, null otherwise.
     */</font>
    Account verify(<font color="navy"><b>final</b></font> String id, <font color="navy"><b>final</b></font> Credential credential);
 
 
    <font color="darkgreen">/**
     * Perform verification when all we have is the Credential, in this case the IdentityManager is also responsible for mapping the Credential to an account.
     *
     * The most common scenario for this would be mapping an X509Certificate to the user it is associated with.
     *
     * @param credential
     * @return
     */</font>
    Account verify(<font color="navy"><b>final</b></font> Credential credential);
 
 
    <font color="darkgreen">/**
     * A temporary method for the Digest mechanism.
     *
     * @param id
     * @return
     */</font>
    Account getAccount(<font color="navy"><b>final</b></font> String id);
 
 
    <font color="darkgreen">/**
     * Return the password for an account. This is an optional method, as is only used for digest auth where the original
     * password is needed to compute the digest.
     *
     * This is an optional method. It is recommended that passwords be stored in a hashed format, so for most identity managers
     * it will not be possible nor desirable to implement this method.
     *
     * @param account the account
     * @return The accounts password
     */</font>
    <font color="navy"><b>char</b></font>[] getPassword(<font color="navy"><b>final</b></font> Account account);
 
 
    <font color="darkgreen">/**
     * Return the pre-prepared hash for the account.
     * @param account - The account the hash is required for.
     * @return The pre-prepared MD5 hash.
     */</font>
    <font color="navy"><b>byte</b></font>[] getHash(<font color="navy"><b>final</b></font> Account account);
 
 
<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>