org.opentox.auth
Class CredentialsVerifier

java.lang.Object
  extended by org.restlet.security.Verifier
      extended by org.restlet.security.SecretVerifier
          extended by org.opentox.auth.CredentialsVerifier

public class CredentialsVerifier
extends org.restlet.security.SecretVerifier

Verifies if some given credentials are valid performing a database query.

Author:
OpenTox - http://www.opentox.org, Sopasakis Pantelis, Sarimveis Harry

Field Summary
private  OpenToxApplication application
           
private  Priviledges authorizationLevel
           
 
Fields inherited from class org.restlet.security.Verifier
RESULT_INVALID, RESULT_MISSING, RESULT_STALE, RESULT_UNSUPPORTED, RESULT_VALID
 
Constructor Summary
CredentialsVerifier(OpenToxApplication application)
          Initialize the CredentialsVerifier.
CredentialsVerifier(OpenToxApplication application, Priviledges authorizationLevel)
          Verifies credentials only if their corresponding authorization level is equal or greater to a specified level.
 
Method Summary
 boolean verify(java.lang.String identifier, char[] inputSecret)
          Verify if a given pair of username and password are valid performing a database query.
 
Methods inherited from class org.restlet.security.SecretVerifier
createUserPrincipal, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

application

private OpenToxApplication application

authorizationLevel

private Priviledges authorizationLevel
Constructor Detail

CredentialsVerifier

public CredentialsVerifier(OpenToxApplication application)
Initialize the CredentialsVerifier.

Parameters:
application -

CredentialsVerifier

public CredentialsVerifier(OpenToxApplication application,
                           Priviledges authorizationLevel)
Verifies credentials only if their corresponding authorization level is equal or greater to a specified level.

Parameters:
application -
authorizationLevel -
Method Detail

verify

public boolean verify(java.lang.String identifier,
                      char[] inputSecret)
Verify if a given pair of username and password are valid performing a database query. The given password is compared to a digest in the database.

Specified by:
verify in class org.restlet.security.SecretVerifier
Parameters:
identifier - the username.
inputSecret - Character Array of the password/
Returns:
true if the user is authenticated and false if not.