Spring Web Services Framework

org.springframework.ws.soap.security.wss4j.callback
Class SimplePasswordValidationCallbackHandler

java.lang.Object
  extended by org.springframework.ws.soap.security.callback.AbstractCallbackHandler
      extended by org.springframework.ws.soap.security.wss4j.callback.AbstractWsPasswordCallbackHandler
          extended by org.springframework.ws.soap.security.wss4j.callback.SimplePasswordValidationCallbackHandler
All Implemented Interfaces:
CallbackHandler, InitializingBean

public class SimplePasswordValidationCallbackHandler
extends AbstractWsPasswordCallbackHandler
implements InitializingBean

Simple callback handler that validates passwords agains a in-memory Properties object. Password validation is done on a case-sensitive basis.

Since:
1.5.0
Author:
Tareq Abed Rabbo, Arjen Poutsma
See Also:
setUsers(java.util.Properties)

Field Summary
 
Fields inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
logger
 
Constructor Summary
SimplePasswordValidationCallbackHandler()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void handleUsernameToken(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.USERNAME_TOKEN usage.
protected  void handleUsernameTokenUnknown(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.USERNAME_TOKEN_UNKNOWN usage.
 void setUsers(Properties users)
          Sets the users to validate against.
 void setUsersMap(Map users)
           
 
Methods inherited from class org.springframework.ws.soap.security.wss4j.callback.AbstractWsPasswordCallbackHandler
handleCleanup, handleCustomToken, handleDecrypt, handleEncryptedKeyToken, handleInternal, handleKeyName, handleSecurityContextToken, handleSignature, handleUsernameTokenPrincipal
 
Methods inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePasswordValidationCallbackHandler

public SimplePasswordValidationCallbackHandler()
Method Detail

setUsers

public void setUsers(Properties users)
Sets the users to validate against. Property names are usernames, property values are passwords.


setUsersMap

public void setUsersMap(Map users)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

handleUsernameToken

protected void handleUsernameToken(WSPasswordCallback callback)
                            throws IOException,
                                   UnsupportedCallbackException
Description copied from class: AbstractWsPasswordCallbackHandler
Invoked when the callback has a WSPasswordCallback.USERNAME_TOKEN usage.

This method is invoked when WSS4J needs the password to fill in or to verify a UsernameToken.

Default implementation throws an UnsupportedCallbackException.

Overrides:
handleUsernameToken in class AbstractWsPasswordCallbackHandler
Throws:
IOException
UnsupportedCallbackException

handleUsernameTokenUnknown

protected void handleUsernameTokenUnknown(WSPasswordCallback callback)
                                   throws IOException,
                                          UnsupportedCallbackException
Description copied from class: AbstractWsPasswordCallbackHandler
Invoked when the callback has a WSPasswordCallback.USERNAME_TOKEN_UNKNOWN usage.

This method is invoked for a not specified password type or a plain text password type. Only the password is set. The callback class now may check if the username and password match. If they don't match, the subclass should throw an exception.

Default implementation throws an UnsupportedCallbackException.

Overrides:
handleUsernameTokenUnknown in class AbstractWsPasswordCallbackHandler
Throws:
IOException
UnsupportedCallbackException

Spring Web Services Framework

Copyright © 2005-2010 The Spring Web Services Framework. All Rights Reserved.