org.apache.ws.security.validate
Class JAASUsernameTokenValidator
java.lang.Object
org.apache.ws.security.validate.JAASUsernameTokenValidator
- All Implemented Interfaces:
- Validator
public class JAASUsernameTokenValidator
- extends java.lang.Object
- implements Validator
This class validates a processed UsernameToken, extracted from the Credential passed to
the validate method.
Username/password validation is delegated to JAAS LoginContext.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JAASUsernameTokenValidator
public JAASUsernameTokenValidator()
setContextName
public void setContextName(java.lang.String name)
getContextName
public java.lang.String getContextName()
validate
public Credential validate(Credential credential,
RequestData data)
throws WSSecurityException
- Validate the credential argument. It must contain a non-null UsernameToken. A
CallbackHandler implementation is also required to be set.
Validator
If the password type is either digest or plaintext, it extracts a password from the
CallbackHandler and then compares the passwords appropriately.
If the password is null it queries a hook to allow the user to validate UsernameTokens
of this type.
- Specified by:
validate
in interface Validator
- Parameters:
credential
- the Credential to be validateddata
- the RequestData associated with the request
- Returns:
- a validated Credential
- Throws:
WSSecurityException
- on a failed validation
getCallbackHandler
protected javax.security.auth.callback.CallbackHandler getCallbackHandler(java.lang.String name,
java.lang.String password)
Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.