Spring Web Services Framework

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

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.SpringSecurityPasswordValidationCallbackHandler
All Implemented Interfaces:
CallbackHandler, InitializingBean

public class SpringSecurityPasswordValidationCallbackHandler
extends AbstractWsPasswordCallbackHandler
implements InitializingBean

Callback handler that validates a plain text or digest password using an Spring Security UserDetailsService.

An Spring Security UserDetailsService is used to load UserDetails from. The digest of the password contained in this details object is then compared with the digest in the message.

Since:
2.1
Author:
Arjen Poutsma

Field Summary
 
Fields inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
logger
 
Constructor Summary
SpringSecurityPasswordValidationCallbackHandler()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void handleCleanup(CleanupCallback callback)
          Invoked when a CleanupCallback is passed to AbstractCallbackHandler.handle(Callback[]).
protected  void handleUsernameToken(WSPasswordCallback callback)
          Invoked when the callback has a WSPasswordCallback.USERNAME_TOKEN usage.
protected  void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback)
          Invoked when a UsernameTokenPrincipalCallback is passed to AbstractCallbackHandler.handle(Callback[]).
 void setUserCache(org.springframework.security.core.userdetails.UserCache userCache)
          Sets the users cache.
 void setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
          Sets the Spring Security user details service.
 
Methods inherited from class org.springframework.ws.soap.security.wss4j.callback.AbstractWsPasswordCallbackHandler
handleCustomToken, handleDecrypt, handleInternal, handleSecretKey, handleSecurityContextToken, handleSignature
 
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

SpringSecurityPasswordValidationCallbackHandler

public SpringSecurityPasswordValidationCallbackHandler()
Method Detail

setUserCache

public void setUserCache(org.springframework.security.core.userdetails.UserCache userCache)
Sets the users cache. Not required, but can benefit performance.


setUserDetailsService

public void setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
Sets the Spring Security user details service. Required.


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

handleUsernameTokenPrincipal

protected void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback)
                                     throws IOException,
                                            UnsupportedCallbackException
Description copied from class: AbstractWsPasswordCallbackHandler
Invoked when a UsernameTokenPrincipalCallback is passed to AbstractCallbackHandler.handle(Callback[]).

Default implementation throws an UnsupportedCallbackException.

Overrides:
handleUsernameTokenPrincipal in class AbstractWsPasswordCallbackHandler
Throws:
IOException
UnsupportedCallbackException

handleCleanup

protected void handleCleanup(CleanupCallback callback)
                      throws IOException,
                             UnsupportedCallbackException
Description copied from class: AbstractWsPasswordCallbackHandler
Invoked when a CleanupCallback is passed to AbstractCallbackHandler.handle(Callback[]).

Default implementation throws an UnsupportedCallbackException.

Overrides:
handleCleanup in class AbstractWsPasswordCallbackHandler
Throws:
IOException
UnsupportedCallbackException

Spring Web Services Framework

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