SimpleAuthenticationInfo

Simple implementation of the {@link hunt.shiro.authc.MergableAuthenticationInfo} interface that holds the principals and credentials.

@see hunt.shiro.realm.AuthenticatingRealm

Constructors

this
this()

Default no-argument constructor.

this
this(Object principal, Object credentials, string realmName)

Constructor that takes in a single 'primary' principal of the account and its corresponding credentials, associated with the specified realm. <p/> This is a convenience constructor and will construct a {@link PrincipalCollection PrincipalCollection} based on the {@code principal} and {@code realmName} argument.

this
this(Object principal, Object hashedCredentials, ByteSource credentialsSalt, string realmName)

Constructor that takes in a single 'primary' principal of the account, its corresponding hashed credentials, the salt used to hash the credentials, and the name of the realm to associate with the principals. <p/> This is a convenience constructor and will construct a {@link PrincipalCollection PrincipalCollection} based on the <code>principal</code> and <code>realmName</code> argument.

this
this(PrincipalCollection principals, Object credentials)

Constructor that takes in an account's identifying principal(s) and its corresponding credentials that verify the principals.

this
this(PrincipalCollection principals, Object hashedCredentials, ByteSource credentialsSalt)

Constructor that takes in an account's identifying principal(s), hashed credentials used to verify the principals, and the salt used when hashing the credentials.

Members

Functions

getCredentials
Object getCredentials()
Undocumented in source. Be warned that the author may not have intended to support it.
getCredentialsSalt
ByteSource getCredentialsSalt()

Returns the salt used to hash the credentials, or {@code null} if no salt was used or credentials were not hashed at all. <p/> Note that this attribute is <em>NOT</em> handled in the {@link #merge(AuthenticationInfo) merge} method - a hash salt is only useful within a single realm (as each realm will perform it's own Credentials Matching logic), and once finished in that realm, Shiro has no further use for salts. Therefore it doesn't make sense to 'merge' salts in a multi-realm scenario.

getPrincipals
PrincipalCollection getPrincipals()
Undocumented in source. Be warned that the author may not have intended to support it.
merge
void merge(AuthenticationInfo info)

Takes the specified <code>info</code> argument and adds its principals and credentials into this instance.

opEquals
bool opEquals(Object o)

Returns <code>true</code> if the Object argument is an <code>instanceof SimpleAuthenticationInfo</code> and its {@link #getPrincipals() principals} are equal to this instance's principals, <code>false</code> otherwise.

setCredentials
void setCredentials(Object credentials)

Sets the credentials that verify the principals/identity of the associated Realm account.

setCredentialsSalt
void setCredentialsSalt(ByteSource salt)

Sets the salt used to hash the credentials, or {@code null} if no salt was used or credentials were not hashed at all. <p/> Note that this attribute is <em>NOT</em> handled in the {@link #merge(AuthenticationInfo) merge} method - a hash salt is only useful within a single realm (as each realm will perform it's own Credentials Matching logic), and once finished in that realm, Shiro has no further use for salts. Therefore it doesn't make sense to 'merge' salts in a multi-realm scenario.

setPrincipals
void setPrincipals(PrincipalCollection principals)

Sets the identifying principal(s) represented by this instance.

toHash
size_t toHash()

Returns the hashcode of the internal {@link #getPrincipals() principals} instance.

toString
string toString()

Simple implementation that merely returns <code>{@link #getPrincipals() principals}.toString()</code>

Variables

credentials
Object credentials;

The credentials verifying the account principals.

credentialsSalt
ByteSource credentialsSalt;

Any salt used in hashing the credentials.

principals
PrincipalCollection principals;

The principals identifying the account associated with this AuthenticationInfo instance.

Inherited Members

From MergableAuthenticationInfo

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.

From SaltedAuthenticationInfo

getCredentialsSalt
ByteSource getCredentialsSalt()

Returns the salt used to salt the account's credentials or {@code null} if no salt was used.

Meta