MergableAuthenticationInfo

<p>An extension of the {@link AuthenticationInfo} interface to be implemented by classes that support merging with other {@link AuthenticationInfo} instances.</p>

<p>This allows an instance of this class to be an <em>aggregation</em>, or <em>composition</em> of account data from across multiple <code>Realm</code>s <tt>Realm</tt>s, not just one realm.</p>

<p>This is useful in a multi-realm authentication configuration - the individual <tt>AuthenticationInfo</tt> objects obtained from each realm can be {@link #merge merged} into a single instance. This instance can then be returned at the end of the authentication process, giving the impression of a single underlying realm/data source.

interface MergableAuthenticationInfo : AuthenticationInfo {}

Members

Functions

merge
void merge(AuthenticationInfo info)

Merges the given {@link AuthenticationInfo} into this instance. The specific way that the merge occurs is up to the implementation, but typically it involves combining the principals and credentials together in this instance. The <code>info</code> argument should not be modified in any way.

Inherited Members

From AuthenticationInfo

getPrincipals
PrincipalCollection getPrincipals()

Returns all principals associated with the corresponding Subject. Each principal is an identifying piece of information useful to the application such as a username, or user id, a given name, etc - anything useful to the application to identify the current <code>Subject</code>. <p/> The returned PrincipalCollection should <em>not</em> contain any credentials used to verify principals, such as passwords, private keys, etc. Those should be instead returned by {@link #getCredentials() getCredentials()}.

getCredentials
Object getCredentials()

Returns the credentials associated with the corresponding Subject. A credential verifies one or more of the {@link #getPrincipals() principals} associated with the Subject, such as a password or private key. Credentials are used by Shiro particularly during the authentication process to ensure that submitted credentials during a login attempt match exactly the credentials here in the <code>AuthenticationInfo</code> instance.

Meta