Class SOAPRequestHandler
- java.lang.Object
-
- com.sun.identity.wss.security.handler.SOAPRequestHandler
-
- All Implemented Interfaces:
SOAPRequestHandlerInterface
public class SOAPRequestHandler extends Object implements SOAPRequestHandlerInterface
This classSOAPRequestHandleris to process and secure the in-bound or out-boundSOAPMessages of the web service clients and web service providers.This class processes the
SOAPMessages for the web services security according to the processing rules defined in OASIS web services security specification and as well as the Liberty Identity Web services security framework.
-
-
Constructor Summary
Constructors Constructor Description SOAPRequestHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageAuthenticatorgetAuthenticator()Returns the configured message authenticator.static MessageAuthorizergetAuthorizer()Returns the configured message authenticator.voidinit(Map config)Initializes the handler with the given configuration.Stringprint(Node node)Prints a Node tree recursively.jakarta.xml.soap.SOAPMessagesecureRequest(jakarta.xml.soap.SOAPMessage soapMessage, Subject subject, Map sharedState)Secures theSOAPMessagerequest by adding necessary credential information.jakarta.xml.soap.SOAPMessagesecureResponse(jakarta.xml.soap.SOAPMessage soapMessage, Map sharedState)Secures the SOAP Message response to the client.ObjectvalidateRequest(jakarta.xml.soap.SOAPMessage soapRequest, Subject subject, Map sharedState, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Authenticates theSOAPMessagefrom a remote client.voidvalidateResponse(jakarta.xml.soap.SOAPMessage soapMessage, Map sharedState)Validates the SOAP Response from the service provider.
-
-
-
Method Detail
-
init
public void init(Map config) throws SecurityException
Initializes the handler with the given configuration.- Specified by:
initin interfaceSOAPRequestHandlerInterface- Parameters:
config- the configuration map to initializate the provider.- Throws:
SecurityException- if the initialization fails.
-
validateRequest
public Object validateRequest(jakarta.xml.soap.SOAPMessage soapRequest, Subject subject, Map sharedState, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws SecurityException
Authenticates theSOAPMessagefrom a remote client.- Specified by:
validateRequestin interfaceSOAPRequestHandlerInterface- Parameters:
soapRequest- SOAPMessage that needs to be validated.subject- the subject that may be used by the callers to store Principals and credentials validated in the request.sharedState- that may be used to store any shared state information betweenvalidateRequest andrequest- theHttpServletRequestassociated with this SOAP Message request.response- theHttpServletResponseassociated with this SOAP Message response.- Returns:
- Object the authenticated token.
- Throws:
SecurityException- if any error occured during validation.
-
secureResponse
public jakarta.xml.soap.SOAPMessage secureResponse(jakarta.xml.soap.SOAPMessage soapMessage, Map sharedState) throws SecurityExceptionSecures the SOAP Message response to the client.- Specified by:
secureResponsein interfaceSOAPRequestHandlerInterface- Parameters:
soapMessage- SOAP Message that needs to be secured.sharedState- a map for the callers to store any state information betweenvalidateRequestandsecureResponse.- Throws:
SecurityException- if any error occurs during securing.
-
secureRequest
public jakarta.xml.soap.SOAPMessage secureRequest(jakarta.xml.soap.SOAPMessage soapMessage, Subject subject, Map sharedState) throws SecurityExceptionSecures theSOAPMessagerequest by adding necessary credential information.- Specified by:
secureRequestin interfaceSOAPRequestHandlerInterface- Parameters:
soapMessage- theSOAPMessagethat needs to be secured.subject- theSubjectof the authenticating entity.sharedState- Any shared state information that may be used between thesecureRequestandvalidateResponse.- Throws:
SecurityException- if any failure for securing the request.
-
validateResponse
public void validateResponse(jakarta.xml.soap.SOAPMessage soapMessage, Map sharedState) throws SecurityExceptionValidates the SOAP Response from the service provider.- Specified by:
validateResponsein interfaceSOAPRequestHandlerInterface- Parameters:
soapMessage- theSOAPMessagethat needs to be validated.sharedState- Any shared data that may be used between thesecureRequestandvalidateResponse.- Throws:
SecurityException- if any failure occured for validating the response.
-
getAuthenticator
public static MessageAuthenticator getAuthenticator() throws SecurityException
Returns the configured message authenticator.- Throws:
SecurityException
-
getAuthorizer
public static MessageAuthorizer getAuthorizer() throws SecurityException
Returns the configured message authenticator.- Throws:
SecurityException
-
print
public String print(Node node)
Prints a Node tree recursively.- Specified by:
printin interfaceSOAPRequestHandlerInterface- Parameters:
node- A DOM tree Node- Returns:
- An xml String representation of the DOM tree.
-
-