public class SPSSOFederate extends Object
Constructor and Description |
---|
SPSSOFederate() |
Modifier and Type | Method and Description |
---|---|
static AuthnRequest |
createAuthnRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String realmName,
String spEntityID,
String idpEntityID,
Map paramsMap,
Map spConfigMap,
List extensionsList,
SPSSODescriptorElement spsso,
IDPSSODescriptorElement idpsso,
String ssourl,
boolean isForECP)
Create an AuthnRequest.
|
static Map<String,Collection<String>> |
getAttrsMapForAuthnReq(String realm,
String spEntityID)
Gets the Configuration attributes for the given sp entity id in the given realm.
|
static Boolean |
getAttrValueFromMap(Map attrMap,
String attrName)
Returns value of an boolean parameter in the SP SSO Config.
|
static List |
getExtensionsList(String entityID,
String realm)
Gets the extensions list for the sp entity.
|
static IDPSSODescriptorElement |
getIDPSSOForAuthnReq(String realm,
String idpEntityID)
Gets the IDP SSO Descriptor for the given sp entity id in the given realm.
|
static String |
getParameter(Map paramsMap,
String attrName)
Gets the query parameter value for the param specified.
|
static String |
getPostBindingMsg(IDPSSODescriptorElement idpsso,
SPSSODescriptorElement spsso,
Map spConfigAttrsMap,
AuthnRequest authnRequest)
Gets the Post Binding message
|
static String |
getRealm(String realm)
Fills in the realm with the default top level realm if it does not contain a more specific subrealm.
|
static String |
getRedirect(String authReqXMLString,
String relayStateID,
String ssoURL,
IDPSSODescriptorElement idpsso,
SPSSODescriptorElement spsso,
Map spConfigAttrsMap)
Gets the redirect String.
|
static String |
getRelayStateID(String relayState,
String requestID)
Gets the Relay State ID for the request.
|
static SingleSignOnServiceElement |
getSingleSignOnServiceEndpoint(List<SingleSignOnServiceElement> ssoServiceList,
String binding)
Returns the SingleSignOnService service.
|
static String |
getSPEntityId(String metaAlias)
Gets the SP Entity ID from the metaAlias.
|
static SPSSODescriptorElement |
getSPSSOForAuthnReq(String realm,
String spEntityID)
Gets the SP SSO Descriptor for the given sp entity id in the given realm.
|
static void |
initiateAuthnRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String metaAlias,
String idpEntityID,
Map paramsMap,
SAML2EventLogger auditor)
Parses the request parameters and builds the Authentication
Request to sent to the IDP.
|
static void |
initiateECPRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Parses the request parameters and builds ECP Request to sent to the IDP.
|
static boolean |
isFromECP(javax.servlet.http.HttpServletRequest request)
Checks if the request is from ECP.
|
static void |
signAuthnRequest(String certAlias,
AuthnRequest authnRequest)
Sign an authentication request.
|
static String |
signQueryString(String queryString,
String certAlias)
Signs the query string.
|
public static void initiateAuthnRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String metaAlias, String idpEntityID, Map paramsMap, SAML2EventLogger auditor) throws SAML2Exception
request
- the HttpServletRequest.response
- the HttpServletResponse.metaAlias
- metaAlias to locate the service providers.idpEntityID
- entityID of Identity Provider.paramsMap
- Map of all other parameters.The key in the
map are of the type String. The values in the paramsMap
are of the type List.
Some of the possible keys are:RelayState,NameIDFormat,
reqBinding, binding, AssertionConsumerServiceIndex,
AttributeConsumingServiceIndex (currently not supported),
isPassive, ForceAuthN, AllowCreate, Destination,
AuthnContextDeclRef, AuthnContextClassRef,
AuthComparison, Consent (currently not supported),
AuthLevel, and sunamcompositeadvice.auditor
- the SAML2EventLogger to use to log the saml request - may be nullSAML2Exception
- if error initiating request to IDP.public static String getSPEntityId(String metaAlias) throws SAML2MetaException
metaAlias
- the metaAlias StringSAML2MetaException
- if there was a problem extractingpublic static String getRedirect(String authReqXMLString, String relayStateID, String ssoURL, IDPSSODescriptorElement idpsso, SPSSODescriptorElement spsso, Map spConfigAttrsMap) throws SAML2Exception
authReqXMLString
- Auth Request XML.relayStateID
- the id of the relay statessoURL
- the url for the reidrectidpsso
- the idp descriptor to usespsso
- the sp descriptor to usespConfigAttrsMap
- the sp configuration detailsSAML2Exception
- if there is a problem creating the redirect stringpublic static SPSSODescriptorElement getSPSSOForAuthnReq(String realm, String spEntityID) throws SAML2MetaException
realm
- the realm the sp is configured inspEntityID
- the entity id of the sp to get the Descriptor forSAML2MetaException
- if there is a problem looking up the SPSSODescriptorElement.public static Map<String,Collection<String>> getAttrsMapForAuthnReq(String realm, String spEntityID) throws SAML2MetaException
realm
- the realm the sp is configured inspEntityID
- the entity id of the sp to get the attributes map forSAML2MetaException
public static IDPSSODescriptorElement getIDPSSOForAuthnReq(String realm, String idpEntityID) throws SAML2MetaException
realm
- the realm the idp is configured inidpEntityID
- the entity id of the idp[ to get the Descriptor forSAML2MetaException
- if there is a problem looking up the IDPSSODescriptorElement.public static String getPostBindingMsg(IDPSSODescriptorElement idpsso, SPSSODescriptorElement spsso, Map spConfigAttrsMap, AuthnRequest authnRequest) throws SAML2Exception
idpsso
- spsso
- spConfigAttrsMap
- authnRequest
- SAML2Exception
public static void initiateECPRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SAML2Exception, IOException
request
- the HttpServletRequest.response
- the HttpServletResponse.SAML2Exception
- if error creating AuthnRequest.IOException
- if error sending AuthnRequest to ECP.public static boolean isFromECP(javax.servlet.http.HttpServletRequest request)
request
- the HttpServletRequest.public static AuthnRequest createAuthnRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String realmName, String spEntityID, String idpEntityID, Map paramsMap, Map spConfigMap, List extensionsList, SPSSODescriptorElement spsso, IDPSSODescriptorElement idpsso, String ssourl, boolean isForECP) throws SAML2Exception
request
- the Http request object.response
- the http response object.realmName
- the authentication realm for this requestspEntityID
- the entity id for the service provideridpEntityID
- the entity id for the identity providerparamsMap
- the map of parameters for the authentication requestspConfigMap
- the configuration map for the service providerextensionsList
- a list of extendsions for the authentication requestspsso
- the SPSSODescriptorElement for theservcie provideridpsso
- the IDPSSODescriptorElement for the identity providerssourl
- the url for the single sign on requestisForECP
- boolean to indicatge if the request originated from an ECPSAML2Exception
public static Boolean getAttrValueFromMap(Map attrMap, String attrName)
attrMap
- the map of attributes for the sso configattrName
- the key to get the boolean value forpublic static SingleSignOnServiceElement getSingleSignOnServiceEndpoint(List<SingleSignOnServiceElement> ssoServiceList, String binding)
ssoServiceList
- list of sso servicesbinding
- binding of the sso service to get the url forpublic static String getRealm(String realm)
realm
- the current realmpublic static String getParameter(Map paramsMap, String attrName)
paramsMap
- the map of parametersattrName
- the parameter name to get the value forpublic static List getExtensionsList(String entityID, String realm)
entityID
- the entity of the id for get the extensions list forrealm
- the realm that the entity is configured inpublic static String getRelayStateID(String relayState, String requestID)
relayState
- the relay staterequestID
- the request idpublic static String signQueryString(String queryString, String certAlias) throws SAML2Exception
queryString
- the query stringcertAlias
- the certificate aliasSAML2Exception
public static void signAuthnRequest(String certAlias, AuthnRequest authnRequest) throws SAML2Exception
certAlias
- the certificate aliasauthnRequest
- the authentication request to signSAML2Exception
- the signed authentication requestCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.