508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * The contents of this file are subject to the terms
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * of the Common Development and Distribution License
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * (the License). You may not use this file except in
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * compliance with the License.
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * You can obtain a copy of the License at
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * https://opensso.dev.java.net/public/CDDLv1.0.html or
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * See the License for the specific language governing
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * permission and limitations under the License.
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * When distributing Covered Code, include this CDDL
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * Header Notice in each file and include the License file
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * If applicable, add the following below the CDDL Header,
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * with the fields enclosed by brackets [] replaced by
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * your own identifying information:
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * "Portions Copyrighted [year] [name of copyright owner]"
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * $Id: AuthnSvcRequestHandlerImpl.java,v 1.2 2008/06/25 05:47:06 qcheng Exp $
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonpackage com.sun.identity.liberty.ws.authnsvc;
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonimport com.sun.identity.liberty.ws.authnsvc.mechanism.MechanismHandler;
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonimport com.sun.identity.liberty.ws.authnsvc.protocol.SASLRequest;
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonimport com.sun.identity.liberty.ws.authnsvc.protocol.SASLResponse;
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonimport com.sun.identity.liberty.ws.common.LogUtil;
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonimport com.sun.identity.liberty.ws.soapbinding.Message;
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonimport com.sun.identity.liberty.ws.soapbinding.RequestHandler;
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe * The class <code>AuthnSvcRequestHandlerImpl</code> is used to process
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe * SASL requests.
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPhersonpublic final class AuthnSvcRequestHandlerImpl implements RequestHandler {
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * Default constructor
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson if (AuthnSvcUtils.debug.messageEnabled()) {
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson "AuthnSvcRequestHanderImpl constructor.");
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * Extracts SASL request out of a SOAP Message and processes it.
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * @param request a SOAP Message containing a SASL request
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * @return a SOAP Message containing a SASL response
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * @exception AuthnSvcException if an error occurs while processing the
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson * SOAP Message
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson public Message processRequest(Message request) throws AuthnSvcException {
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson List list = request.getBodies(AuthnSvcConstants.NS_AUTHN_SVC,
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson throw new AuthnSvcException("missingSASLRequet");
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson throw new AuthnSvcException("tooManySASLRequet");
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson SASLRequest saslReq = new SASLRequest((Element)list.get(0));
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson saslReq.setMessageID(request.getCorrelationHeader().getMessageID());
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson saslReq.setRefToMessageID(request.getCorrelationHeader()
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson String respMessageID = message.getCorrelationHeader().getMessageID();
508aff1a85ed04f187fd074799bcaefd630490f1James C. McPherson SASLResponse saslResp = processSASLRequest(saslReq, request,
return message;
throws AuthnSvcException {
return saslResp;