public static void sendResponseWithStatus(HttpServletRequest request,HttpServletResponse response,PrintWriter out,String idpMetaAlias,String idpEntityID,String realm,AuthnRequest authnReq,String relayState,String spEntityID,String firstlevelStatusCodeValue,String secondlevelStatusCodeValue) throws SAML2Exception {
  Response res=SAML2Utils.getErrorResponse(authnReq,firstlevelStatusCodeValue,secondlevelStatusCodeValue,null,idpEntityID);
  StringBuffer returnedBinding=new StringBuffer();
  String acsURL=IDPSSOUtil.getACSurl(spEntityID,realm,authnReq,request,returnedBinding);
  String acsBinding=returnedBinding.toString();
  sendResponse(request,response,out,acsBinding,spEntityID,idpEntityID,idpMetaAlias,realm,relayState,acsURL,res,null);
}

public static void sendResponseWithStatus ( HttpServletRequest request , HttpServletResponse response , PrintWriter out , String idpMetaAlias , String idpEntityID , String realm , AuthnRequest authnReq , String relayState , String spEntityID , String firstlevelStatusCodeValue , String secondlevelStatusCodeValue ) throws SAML2Exception { Response res = SAML2Utils . getErrorResponse ( authnReq , firstlevelStatusCodeValue , secondlevelStatusCodeValue , null , idpEntityID ) ; StringBuffer returnedBinding = new StringBuffer ( ) ; String acsURL = IDPSSOUtil . getACSurl ( spEntityID , realm , authnReq , request , returnedBinding ) ; String acsBinding = returnedBinding . toString ( ) ; sendResponse ( request , response , out , acsBinding , spEntityID , idpEntityID , idpMetaAlias , realm , relayState , acsURL , res , null ) ; }
a convenience method to construct response with first - level and second - level status code for saml authentication requests .
