|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shiro.authc.SimpleAuthenticationInfo
public class SimpleAuthenticationInfo
Simple implementation of the MergableAuthenticationInfo interface that holds the principals and
credentials.
AuthenticatingRealm,
Serialized Form| Field Summary | |
|---|---|
protected Object |
credentials
The credentials verifying the account principals. |
protected PrincipalCollection |
principals
The principals identifying the account associated with this AuthenticationInfo instance. |
| Constructor Summary | |
|---|---|
SimpleAuthenticationInfo()
Default no-argument constructor. |
|
SimpleAuthenticationInfo(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. |
|
SimpleAuthenticationInfo(PrincipalCollection principals,
Object credentials)
Constructor that takes in an account's identifying principal(s) and its corresponding credentials that verify the principals. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Returns true if the Object argument is an instanceof SimpleAuthenticationInfo and
its principals are equal to this instance's principals, false otherwise. |
Object |
getCredentials()
Returns the credentials associated with the corresponding Subject. |
PrincipalCollection |
getPrincipals()
Returns all principals associated with the corresponding Subject. |
int |
hashCode()
Returns the hashcode of the internal principals instance. |
void |
merge(AuthenticationInfo info)
Takes the specified info argument and adds its principals and credentials into this instance. |
void |
setCredentials(Object credentials)
Sets the credentials that verify the principals/identity of the associated Realm account. |
void |
setPrincipals(PrincipalCollection principals)
Sets the identifying principal(s) represented by this instance. |
String |
toString()
Simple implementation that merely returns |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected PrincipalCollection principals
protected Object credentials
| Constructor Detail |
|---|
public SimpleAuthenticationInfo()
public SimpleAuthenticationInfo(Object principal,
Object credentials,
String realmName)
PrincipalCollection based
on the principal and realmName argument.
principal - the 'primary' principal associated with the specified realm.credentials - the credentials that verify the given principal.realmName - the realm from where the principal and credentials were acquired.
public SimpleAuthenticationInfo(PrincipalCollection principals,
Object credentials)
principals - a Realm's account's identifying principal(s)credentials - the accounts corresponding principals that verify the principals.| Method Detail |
|---|
public PrincipalCollection getPrincipals()
AuthenticationInfoSubject.
The returned PrincipalCollection should not contain any credentials used to verify principals, such
as passwords, private keys, etc. Those should be instead returned by getCredentials().
getPrincipals in interface AuthenticationInfopublic void setPrincipals(PrincipalCollection principals)
principals - the indentifying attributes of the corresponding Realm account.public Object getCredentials()
AuthenticationInfoprincipals 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 AuthenticationInfo instance.
getCredentials in interface AuthenticationInfopublic void setCredentials(Object credentials)
credentials - attribute(s) that verify the account's identity/principals, such as a password or private key.public void merge(AuthenticationInfo info)
info argument and adds its principals and credentials into this instance.
merge in interface MergableAuthenticationInfoinfo - the AuthenticationInfo to add into this instance.public boolean equals(Object o)
true if the Object argument is an instanceof SimpleAuthenticationInfo and
its principals are equal to this instance's principals, false otherwise.
equals in class Objecto - the object to compare for equality.
true if the Object argument is an instanceof SimpleAuthenticationInfo and
its principals are equal to this instance's principals, false otherwise.public int hashCode()
principals instance.
hashCode in class Objectprincipals instance.public String toString()
principals.toString()
toString in class Objectprincipals.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||