Search in sources :

Example 1 with SASLRequest

use of com.sun.identity.liberty.ws.authnsvc.protocol.SASLRequest in project OpenAM by OpenRock.

the class AuthnSvcRequestHandlerImpl method processRequest.

/**
     * Extracts SASL request out of a SOAP Message and processes it.
     * @param request a SOAP Message containing a SASL request
     * @return a SOAP Message containing a SASL response
     * @exception AuthnSvcException if an error occurs while processing the
     *                              SOAP Message
     */
public Message processRequest(Message request) throws AuthnSvcException {
    List list = request.getBodies(AuthnSvcConstants.NS_AUTHN_SVC, AuthnSvcConstants.TAG_SASL_REQUEST);
    if (list.isEmpty()) {
        throw new AuthnSvcException("missingSASLRequet");
    } else if (list.size() > 1) {
        throw new AuthnSvcException("tooManySASLRequet");
    }
    SASLRequest saslReq = new SASLRequest((Element) list.get(0));
    saslReq.setMessageID(request.getCorrelationHeader().getMessageID());
    saslReq.setRefToMessageID(request.getCorrelationHeader().getRefToMessageID());
    Message message = new Message();
    String respMessageID = message.getCorrelationHeader().getMessageID();
    SASLResponse saslResp = processSASLRequest(saslReq, request, respMessageID);
    message.setSOAPBody(saslResp.toElement());
    return message;
}
Also used : SASLRequest(com.sun.identity.liberty.ws.authnsvc.protocol.SASLRequest) Message(com.sun.identity.liberty.ws.soapbinding.Message) SASLResponse(com.sun.identity.liberty.ws.authnsvc.protocol.SASLResponse) List(java.util.List)

Aggregations

SASLRequest (com.sun.identity.liberty.ws.authnsvc.protocol.SASLRequest)1 SASLResponse (com.sun.identity.liberty.ws.authnsvc.protocol.SASLResponse)1 Message (com.sun.identity.liberty.ws.soapbinding.Message)1 List (java.util.List)1