spSSOInit.jsp revision 0e107349d3f7763a9c67fb2f32c86c11364c72cf
321N/A $Id: spSSOInit.jsp,v 1.11 2009/06/24 23:05:30 mrudulahg Exp $
970N/A<%@ page import="com.sun.identity.shared.debug.Debug" %>
1339N/A<%@ page import="com.sun.identity.saml2.common.SAML2Constants" %>
1339N/A<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
1339N/A<%@ page import="com.sun.identity.saml.common.SAMLUtils" %>
321N/A<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
1276N/A<%@ page import="com.sun.identity.saml2.profile.SPCache" %>
321N/A<%@ page import="com.sun.identity.saml2.profile.SPSSOFederate" %>
911N/A<%@ page import="java.util.HashMap" %>
1276N/A<%@ page import="java.util.ArrayList" %>
1276N/A<%@ page import="java.util.List" %>
1276N/A<%@ page import="java.util.Map" %>
911N/A<%@ page import="java.util.StringTokenizer" %>
321N/A spssoinit.jsp initiates the Single Sign-On at the Service Provider.
970N/A this parameter is /realm_name/SP name.
3. RelayState Target URL on successful complete of SSO/Federation
e.g. if the request URL has :
SSO/Federation user will be redirected to the TARGET URL.
11.AllowCreate Value indicates if IDP is allowed to created a new
12.Destination A URI Reference indicating the address to which the
13.AuthnContextDeclRef Specifies the AuthnContext Declaration Reference.
14.AuthnContextClassRef Specifies the AuthnContext Class References.
16.AuthComparison The comparison method used to evaluate the
17.Consent Specifies a URI a SAML defined identifier
known as Consent Identifiers.These are defined in
18.reqBinding URI value that identifies a SAML protocol binding to
19.affiliationID affiliation entity ID
20.sunamcompositeadvice URLEncoded XML blob that specifies auth level
String reqID = request.getParameter("requestID");
idpEntityID = SAML2Utils.getPreferredIDP(request);
paramsMap = (Map)SPCache.reqParamHash.get(reqID);
metaAlias = (String) paramsMap.get("metaAlias");
SPCache.reqParamHash.remove(reqID);
metaAlias = request.getParameter("metaAlias");
if ((metaAlias == null) || (metaAlias.length() == 0)) {
SAMLUtils.sendError(request, response,
response.SC_BAD_REQUEST, "nullSPEntityID",
SAML2Utils.bundle.getString("nullSPEntityID"));
idpEntityID = request.getParameter("idpEntityID");
paramsMap = SAML2Utils.getParamsMap(request);
if ((idpEntityID == null) || (idpEntityID.length() == 0)) {
String readerURL = SAML2Utils.getReaderURL(metaAlias);
String rID = SAML2Utils.generateID();
SAML2Utils.getRedirectURL(readerURL,rID,request);
paramsMap.put("metaAlias",metaAlias);
SPCache.reqParamHash.put(rID,paramsMap);
response.sendRedirect(redirectURL);
if ((idpEntityID == null) || (idpEntityID.length() == 0)) {
SAMLUtils.sendError(request, response,
response.SC_BAD_REQUEST, "nullIDPEntityID",
SAML2Utils.bundle.getString("nullIDPEntityID"));
SPSSOFederate.initiateAuthnRequest( request,response,metaAlias,
SAML2Utils.debug.error("Error sending AuthnRequest " , sse);
SAMLUtils.sendError(request, response,
response.SC_BAD_REQUEST, "requestProcessingError",
SAML2Utils.bundle.getString("requestProcessingError") + " " +
sse.getMessage());
SAML2Utils.debug.error("Error processing Request ",e);
SAML2Utils.bundle.getString("requestProcessingError") + " " +
e.getMessage());