public class FSServiceUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
addMetaAlias(String url,
String metaAlias)
Appends meta alias to the URL.
|
static SOAPMessage |
convertDOMToSOAP(Document doc)
Converts
DOM document to SOAP message. |
static Node |
createSOAPDOM(SOAPMessage message)
Converts
SOAP message to DOM element. |
static String |
getAffiliationID(String realm,
String entityID)
Gets the Affiliation ID for the provider that it belongs.
|
static String |
getAssertionConsumerServiceURL(com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor,
String id)
Finds approriate assertion consumer service URL.
|
static String |
getBaseURL() |
static String |
getBaseURL(javax.servlet.http.HttpServletRequest request)
Returns base url of a request.
|
static String |
getCommonLoginPageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
Returns common login page URL.
|
static String |
getCommonLoginPageURL(String metaAlias,
String resourceUrl,
String requestId,
javax.servlet.http.HttpServletRequest request,
String baseURL)
Returns common login page URL based on the deployment descriptor and
the meta alias associated with the hosted provider.
|
static String |
getConsentPageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
Returns the list of circle of trusts page URL.
|
static String |
getDefaultPageURL(javax.servlet.http.HttpServletRequest request,
String pageName)
Returns default page URL.
|
static String |
getDoFederatePageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
Returns do federate page URL.
|
static String |
getErrorPageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig,
String metaAlias)
Returns error page URL.
|
static String |
getFederationDonePageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig,
String metaAlias)
Returns federation done page URL.
|
static String |
getFirstProtocolProfile(List profiles)
Returns the first profile from the list.
|
static String |
getLocale(javax.servlet.http.HttpServletRequest request)
Retrieves locale of a http request.
|
static String |
getLogoutDonePageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig,
String metaAlias)
Returns logout done page URL.
|
static String |
getMetaAlias(javax.servlet.http.HttpServletRequest request)
Retrieves meta alias of a provider from http request.
|
static int |
getMinorVersion(List protocolEnum)
Returns the minor version of supported protocol.
|
static String |
getRegistrationDonePageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig,
String metaAlias)
Returns registration done page URL.
|
static String |
getServicesBaseURL(javax.servlet.http.HttpServletRequest request)
Returns the base URL for OpenAM services deployment.
|
static FederationSPAdapter |
getSPAdapter(String hostEntityID,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostSPConfig) |
static Map |
getSPAuthContextInfo(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostConfig)
Returns service provider's authentication context mappings.
|
static String |
getTerminationDonePageURL(javax.servlet.http.HttpServletRequest request,
com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig,
String metaAlias)
Returns termination done page URL.
|
static boolean |
isLECPProfile(javax.servlet.http.HttpServletRequest request)
Determines whether the request contains LECP header or not.
|
static boolean |
isRegisProfileSOAP(String userID,
String remoteEntityId,
com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType remoteDescriptor,
String metaAlias,
com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorType hostedDescriptor)
Determines if the registration profile is SOAP or not.
|
static boolean |
isSigningOn()
Returns
true if signing is enabled; otherwise, it will
return false. |
static boolean |
isSigningOptional()
Returns
true if signing is optional else it will return
false . |
static Map |
parseAttributeConfig(List list)
Parses the attribute map configuration and returns as java
java.util.Map . |
static String |
printDocument(Node root)
Outputs the DOM representation given as root as XML string.
|
static void |
redirectForAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String hostedProviderAlias)
Redirects the HTTP request to the Authentication module.
|
static void |
returnLocallyAfterOperation(javax.servlet.http.HttpServletResponse response,
String opDoneURL,
boolean isSuccess,
String successString,
String failureString)
Invoked at the end when an operation is done.
|
static void |
returnToSource(javax.servlet.http.HttpServletResponse response,
String retURL,
String commonErrorPage,
String errorLocaleString,
String remarkLocaleString)
Determines the return location and redirects based on
federation termination Return URL of the provider that sent the
termination request
|
static void |
showErrorPage(javax.servlet.http.HttpServletResponse response,
String commonErrorPage,
String errorLocaleString,
String remarkLocaleString)
Displays error page.
|
public static boolean isSigningOn()
true
if signing is enabled; otherwise, it will
return false. If signing is enabled, all the liberty requests/responses
must be signed/verfied.true
if signing is on; otherwise, return
false
public static boolean isSigningOptional()
true
if signing is optional else it will return
false
. If signing is optional, sign/verfy
Response/Assertion
only if it is required by the
specification.true
if signing is optional; otherwise return
false
public static String getCommonLoginPageURL(String metaAlias, String resourceUrl, String requestId, javax.servlet.http.HttpServletRequest request, String baseURL)
metaAlias
- the meta alias of the hosted providerresourceUrl
- resource URL to redirect torequestId
- the AuthnRequest
Idrequest
- HttpServletRequest
objectbaseURL
- deployment base URLnull
if an error
occurred during the process.public static String getBaseURL()
public static String getMetaAlias(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest
objectpublic static String getLocale(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest
objectnull
if locale cannot
be retrieved.public static String getServicesBaseURL(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequestpublic static String getBaseURL(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest
objectpublic static String printDocument(Node root) throws TransformerException, TransformerConfigurationException, FileNotFoundException
root
- The DOM
representation to be outputtedDOM
node.TransformerException,
- TransformerConfigurationException,
FileNotFoundExceptionTransformerException
TransformerConfigurationException
FileNotFoundException
public static Node createSOAPDOM(SOAPMessage message)
SOAP
message to DOM
element.message
- SOAP
messageDOM
elementpublic static SOAPMessage convertDOMToSOAP(Document doc)
DOM
document to SOAP
message.doc
- DOM
documentSOAP
messagepublic static boolean isLECPProfile(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest
objecttrue
if the request contains LECP header;
false
otherwise.public static String getAffiliationID(String realm, String entityID)
realm
- The realm under which the entity resides.entityID
- provider's entity ID.public static Map parseAttributeConfig(List list)
java.util.Map
.list
- attribute configuration.public static void showErrorPage(javax.servlet.http.HttpServletResponse response, String commonErrorPage, String errorLocaleString, String remarkLocaleString)
response
- HttpServletResponse
objectcommonErrorPage
- redirect url for error pageerrorLocaleString
- locale string for the error messageremarkLocaleString
- locale string for the error remarkpublic static void redirectForAuthentication(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String hostedProviderAlias) throws IOException
request
- HttpServletRequest
object that contains the
request the client has made of the servlet.response
- HttpServletResponse
object that contains
the response the servlet sends to the client.hostedProviderAlias
- meta alias that identifies the local hosted
providerIOException
- If an input or output exception occurspublic static void returnLocallyAfterOperation(javax.servlet.http.HttpServletResponse response, String opDoneURL, boolean isSuccess, String successString, String failureString)
response
- the HttpServletResponse
objectopDoneURL
- where to go when an operation is doneisSuccess
- determines the content of the operation-done.jspsuccessString
- success string to be appended to url if
isSuccess
is true.failureString
- failure string to be appended to url if
isSuccess
is false.public static void returnToSource(javax.servlet.http.HttpServletResponse response, String retURL, String commonErrorPage, String errorLocaleString, String remarkLocaleString)
response
- http response objectretURL
- operation return urlcommonErrorPage
- where to go if error occurserrorLocaleString
- locale string for federation errorremarkLocaleString
- locale string for federation remarkpublic static String getConsentPageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metapublic static String getCommonLoginPageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metapublic static String getErrorPageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig, String metaAlias)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metametaAlias
- hosted provider's meta aliaspublic static String getTerminationDonePageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig, String metaAlias)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metametaAlias
- hosted provider's meta aliaspublic static String getRegistrationDonePageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig, String metaAlias)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metametaAlias
- hosted provider's meta aliaspublic static String getLogoutDonePageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig, String metaAlias)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metametaAlias
- hosted provider's meta aliaspublic static String getFederationDonePageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig, String metaAlias)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metametaAlias
- hosted provider's meta aliaspublic static String getDoFederatePageURL(javax.servlet.http.HttpServletRequest request, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
request
- HttpServletRequest
objecthostedConfig
- hosted provider's extended metapublic static String getDefaultPageURL(javax.servlet.http.HttpServletRequest request, String pageName)
request
- HTTP Servlet Request.pageName
- the page name whose url to be retrievedpublic static String addMetaAlias(String url, String metaAlias)
url
- string urlmetaAlias
- meta alias to be appendedpublic static String getAssertionConsumerServiceURL(com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor, String id)
spDescriptor
- sevice provider's meta descriptorid
- requested assertion consumer service url id. It could be
null
.public static String getFirstProtocolProfile(List profiles)
profiles
- list of profilespublic static Map getSPAuthContextInfo(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostConfig)
hostConfig
- hosted provider' setended metapublic static boolean isRegisProfileSOAP(String userID, String remoteEntityId, com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType remoteDescriptor, String metaAlias, com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorType hostedDescriptor)
userID
- id of the user subject to registrationremoteEntityId
- remote provider's entity IDremoteDescriptor
- remote provider's meta descriptormetaAlias
- hosted provider's meta aliashostedDescriptor
- hosted provider's meta descriptortrue
if the registration profile is SOAP;
false
otherwise.public static int getMinorVersion(List protocolEnum)
protocolEnum
- list of supported protocolspublic static FederationSPAdapter getSPAdapter(String hostEntityID, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostSPConfig)
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.