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;
}
Aggregations