|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Account
An Account represents system-specific account/user information in an application-independent manner. Instead of forcing a JSecurity user to implement User or Role interfaces and being invasive on an application's data model, the application instead returns instances of this interface to represent such data. This enables a cleaner pluggable implementation and abstracts an application's core classes away from JSecurity.
In fact, JSecurity's default implementations of this interface are usually good for the majority of applications and no additional implementation is required.
Please note: Since JSecurity sometimes logs account operations, please ensure your Account's toString()
implementation does not print out account credentials (password, etc), as these might be viewable to
someone reading your logs. This is good practice anyway, and account principals should rarely (if ever) be printed
out for any reason. If you're using JSecurity's default implementations of this interface, they only ever print the
account principal, so you do not need to do anything additional.
SimpleAccount,
SimpleAuthorizingAccount| Method Summary | |
|---|---|
Object |
getCredentials()
The account's credentials as stored in the system associated with the account identifier, such as a password or private key. |
Object |
getPrincipal()
Returns the account's identifying principal, such as a user id or username. |
boolean |
isCredentialsExpired()
Determines if the user's credentials (e.g. password) have expired and must be changed before login is allowed. |
boolean |
isLocked()
Determines if the account is locked, meaning that the user is not allowed to log in due to a manual or automatic lockout. |
| Method Detail |
|---|
Object getPrincipal()
In a multi-realm configuration, the object returned from this method might be an implementation-specific object representing multiple principals. This might be an instance of java.util.Collection, but it does not have to be - it is up to the Authenticator's modular authentication strategy as to exactly what is returned.
Object getCredentials()
account identifier, such as a password or private key.
It could be encrypted in which case an
Realm
must be aware of the fact (e.g. via configuration) in order to interpret and compare
the credentials value.
identifierboolean isLocked()
boolean isCredentialsExpired()
|
JSecurity | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||