|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjecteTextReader.clientInterface.DBAuthenticator
public class DBAuthenticator
This class is an Authenticator which stores a user's password in a database; the password is stored in encrypted form using the encryption provided by a StringCrypto object
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface eTextReader.authentication.Authenticator |
---|
Authenticator.AUTHENTICATION_RESULT |
Field Summary | |
---|---|
(package private) DBClient |
client
|
(package private) StringCrypto |
crypto
|
Constructor Summary | |
---|---|
DBAuthenticator()
|
Method Summary | |
---|---|
Authenticator.AUTHENTICATION_RESULT |
authenticate(java.lang.Object identity,
java.lang.Object secret)
Attempts to verify the user identified by identity using the supplied secret. |
java.lang.String |
getOperationalErrorDescription()
Provides feedback when an Authenticator specific operational error occurs. |
java.lang.String |
getOtherErrorDescription()
Provides feedback when a Authenticator specific error condition arises. |
Authenticator.AUTHENTICATION_RESULT |
updateSecret(java.lang.Object identity,
java.lang.Object oldSecret,
java.lang.Object newSecret)
Provides a mechanism for a user's secret to be updated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
StringCrypto crypto
DBClient client
Constructor Detail |
---|
public DBAuthenticator() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
Method Detail |
---|
public Authenticator.AUTHENTICATION_RESULT authenticate(java.lang.Object identity, java.lang.Object secret)
Authenticator
Attempts to verify the user identified by identity using the supplied secret.
If the supplied secret matches that known to this Authenticator, then the enum value SUCCESS should be returned. If authentication fails, the Authenticator can choose to provide specific feedback, such as the fact that an unknown identity was presented, at the Authenticator implementor's discretion. If specified feedback is not desired, the enum value FAILED should be returned. Implementors can indicate custom return values through the use of the OTHER_ERROR enum value. If OTHER_ERROR is returned, then the result the method getOtherErrorDescription should return a description of the error so that the user can be provided with feedback.
If an implementation specific error occurs, such as a failure to contact a specific database, then the enum value OPERATIONAL_ERROR should be returned, and the method getOperationalErrorDescription should return a description of the error so that the user can be provided with feedback.
authenticate
in interface Authenticator
identity
- an object used to identify a given individualsecret
- an object known/possessed by only the individual identified by identity
public java.lang.String getOperationalErrorDescription()
Authenticator
getOperationalErrorDescription
in interface Authenticator
public java.lang.String getOtherErrorDescription()
Authenticator
getOtherErrorDescription
in interface Authenticator
public Authenticator.AUTHENTICATION_RESULT updateSecret(java.lang.Object identity, java.lang.Object oldSecret, java.lang.Object newSecret)
Authenticator
updateSecret
in interface Authenticator
identity
- an object used to identify a given useroldSecret
- the user's current secretnewSecret
- the new secret to be used for the given user
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |