Class JAASUsernameTokenValidator

java.lang.Object
org.apache.wss4j.dom.validate.JAASUsernameTokenValidator
All Implemented Interfaces:
Validator

public class JAASUsernameTokenValidator extends 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.
  • Constructor Details

    • JAASUsernameTokenValidator

      public JAASUsernameTokenValidator()
  • Method Details

    • setContextName

      public void setContextName(String name)
    • getContextName

      public 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 validated
      data - the RequestData associated with the request
      Returns:
      a validated Credential
      Throws:
      WSSecurityException - on a failed validation
    • getCallbackHandler

      protected CallbackHandler getCallbackHandler(String name, String password)