Class SpringSecurityPasswordValidationCallbackHandler
java.lang.Object
org.springframework.ws.soap.security.callback.AbstractCallbackHandler
org.springframework.ws.soap.security.wss4j2.callback.AbstractWsPasswordCallbackHandler
org.springframework.ws.soap.security.wss4j2.callback.SpringSecurityPasswordValidationCallbackHandler
- All Implemented Interfaces:
CallbackHandler
,org.springframework.beans.factory.InitializingBean
public class SpringSecurityPasswordValidationCallbackHandler
extends AbstractWsPasswordCallbackHandler
implements org.springframework.beans.factory.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.3.0
- Author:
- Arjen Poutsma, Jamin Hitchcock
-
Field Summary
Fields inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
handleCleanup
(CleanupCallback callback) Invoked when aCleanupCallback
is passed toAbstractCallbackHandler.handle(Callback[])
.protected void
handleUsernameToken
(org.apache.wss4j.common.ext.WSPasswordCallback callback) Invoked when the callback has aWSPasswordCallback.USERNAME_TOKEN
usage.protected void
Invoked when aUsernameTokenPrincipalCallback
is passed toAbstractCallbackHandler.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.wss4j2.callback.AbstractWsPasswordCallbackHandler
handleCustomToken, handleDecrypt, handleInternal, handleSecretKey, handleSecurityContextToken, handleSignature
Methods inherited from class org.springframework.ws.soap.security.callback.AbstractCallbackHandler
handle
-
Constructor Details
-
SpringSecurityPasswordValidationCallbackHandler
public SpringSecurityPasswordValidationCallbackHandler()
-
-
Method Details
-
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
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
handleUsernameToken
protected void handleUsernameToken(org.apache.wss4j.common.ext.WSPasswordCallback callback) throws IOException, UnsupportedCallbackException Invoked when the callback has aWSPasswordCallback.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 classAbstractWsPasswordCallbackHandler
- Throws:
IOException
UnsupportedCallbackException
-
handleUsernameTokenPrincipal
protected void handleUsernameTokenPrincipal(UsernameTokenPrincipalCallback callback) throws IOException, UnsupportedCallbackException Description copied from class:AbstractWsPasswordCallbackHandler
Invoked when aUsernameTokenPrincipalCallback
is passed toAbstractCallbackHandler.handle(Callback[])
.Default implementation throws an
UnsupportedCallbackException
.- Overrides:
handleUsernameTokenPrincipal
in classAbstractWsPasswordCallbackHandler
- Throws:
IOException
UnsupportedCallbackException
-
handleCleanup
protected void handleCleanup(CleanupCallback callback) throws IOException, UnsupportedCallbackException Description copied from class:AbstractWsPasswordCallbackHandler
Invoked when aCleanupCallback
is passed toAbstractCallbackHandler.handle(Callback[])
.Default implementation throws an
UnsupportedCallbackException
.- Overrides:
handleCleanup
in classAbstractWsPasswordCallbackHandler
- Throws:
IOException
UnsupportedCallbackException
-