Class FSNameRegistrationHandler
- java.lang.Object
-
- com.sun.identity.federation.services.registration.FSNameRegistrationHandler
-
public class FSNameRegistrationHandler extends Object
Work class that handles registration process.
-
-
Field Summary
Fields Modifier and Type Field Description protected FSAccountFedInfoacctInfoprotected com.sun.identity.federation.jaxb.entityconfig.BaseConfigTypehostedConfigprotected com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorTypehostedDescriptorprotected StringhostedEntityIdprotected StringhostedProviderRoleprotected FSAccountManagermanagerInstprotected StringmetaAliasprotected FSAccountFedInfonewAcctInfoprotected FSAccountFedInfoKeynewAcctKeyprotected FSAccountFedInfoKeyoldAcctKeyprotected Stringrealmprotected HashMapregisMapprotected FSNameRegistrationRequestregisRequestprotected FSNameRegistrationResponseregisResponseprotected static StringregisSourceprotected static StringREGISTRATION_DONE_URLprotected static StringRELAY_STATEprotected StringrelayStateprotected com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorTyperemoteDescriptorprotected StringremoteEntityIdprotected jakarta.servlet.http.HttpServletRequestrequestprotected jakarta.servlet.http.HttpServletResponseresponseprotected HashMapreturnMapprotected static StringreturnURLprotected ObjectssoTokenprotected StringuserID
-
Constructor Summary
Constructors Constructor Description FSNameRegistrationHandler()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhandleNameRegistration(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object ssoToken)Initiates the name registration operation.booleanhandleNameRegistration(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object ssoToken, HashMap valMap)Handles the name registration after sso.booleanhandleRegistrationAfterFederation(String LRURL, jakarta.servlet.http.HttpServletResponse response)Does local name registration and initiates remote registration with the IDP.voidprocessRegistrationRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSNameRegistrationRequest regisRequest)Processes the registration request received from a remote provider.booleanprocessRegistrationResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSNameRegistrationResponse regisResponse)Initiates the name registration operation.FSNameRegistrationResponseprocessSOAPRegistrationRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSNameRegistrationRequest regisRequest)Processes the name registration request received from a remote provider.voidreturnLocallyAtSource(jakarta.servlet.http.HttpServletResponse response, boolean isSuccess)Redirects to final destination after registration.voidsetAccountInfo(FSAccountFedInfo acctInfo)Sets the federation account information for the user with a specific remote provider.voidsetHostedDescriptor(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType hostedDescriptor)Sets hosted provider descriptor.voidsetHostedDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)Sets hosted provider's extended meta.voidsetHostedEntityId(String hostedId)Sets hosted provider's entity ID.voidsetHostedProviderRole(String hostedRole)Sets hosted provider's role.voidsetMetaAlias(String metaAlias)Sets hosted provider's meta alias.voidsetRealm(String realm)Sets realm.protected voidsetRegistrationURL()Invoked to set some commonly used URLs based on hosted provider.voidsetRemoteDescriptor(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType remoteDescriptor)Sets remote provider descriptor.voidsetRemoteEntityId(String remoteId)Sets remote provider's entity ID.booleansetUserDN(FSNameRegistrationRequest regisRequest)Determines the user based on the registration request received from a remote provider.voidsetUserID(String userID)Sets the UserDN.protected jakarta.xml.soap.SOAPMessagesignRegistrationRequest(jakarta.xml.soap.SOAPMessage msg, String idAttrName, String id)Signs the Name registration request before sending it to the IDP.protected booleanverifyResponseSignature(jakarta.xml.soap.SOAPMessage msg, boolean isIDP)Verifies the Name registration response received from the IDP before processing locally.
-
-
-
Field Detail
-
response
protected jakarta.servlet.http.HttpServletResponse response
-
request
protected jakarta.servlet.http.HttpServletRequest request
-
regisMap
protected HashMap regisMap
-
regisResponse
protected FSNameRegistrationResponse regisResponse
-
regisRequest
protected FSNameRegistrationRequest regisRequest
-
ssoToken
protected Object ssoToken
-
userID
protected String userID
-
acctInfo
protected FSAccountFedInfo acctInfo
-
newAcctInfo
protected FSAccountFedInfo newAcctInfo
-
newAcctKey
protected FSAccountFedInfoKey newAcctKey
-
oldAcctKey
protected FSAccountFedInfoKey oldAcctKey
-
remoteDescriptor
protected com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType remoteDescriptor
-
hostedDescriptor
protected com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType hostedDescriptor
-
hostedConfig
protected com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig
-
metaAlias
protected String metaAlias
-
relayState
protected String relayState
-
managerInst
protected FSAccountManager managerInst
-
REGISTRATION_DONE_URL
protected static String REGISTRATION_DONE_URL
-
RELAY_STATE
protected static final String RELAY_STATE
- See Also:
- Constant Field Values
-
returnMap
protected HashMap returnMap
-
returnURL
protected static String returnURL
-
regisSource
protected static String regisSource
-
remoteEntityId
protected String remoteEntityId
-
realm
protected String realm
-
hostedEntityId
protected String hostedEntityId
-
hostedProviderRole
protected String hostedProviderRole
-
-
Method Detail
-
setRegistrationURL
protected void setRegistrationURL()
Invoked to set some commonly used URLs based on hosted provider.
-
setHostedDescriptor
public void setHostedDescriptor(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType hostedDescriptor)
Sets hosted provider descriptor. This function is called from FSServiceManager to give state to the name registration handler that is handling the current name registration. The hosted provider identifies the provider who is handling the registration request or initiating it locally.- Parameters:
hostedDescriptor- the Hosted provider Descriptor
-
setHostedDescriptorConfig
public void setHostedDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
Sets hosted provider's extended meta.- Parameters:
hostedConfig- hosted provider's extended meta.
-
setHostedEntityId
public void setHostedEntityId(String hostedId)
Sets hosted provider's entity ID.- Parameters:
hostedId- hosted provider's entity ID
-
setHostedProviderRole
public void setHostedProviderRole(String hostedRole)
Sets hosted provider's role.- Parameters:
hostedRole- hosted provider's role
-
setMetaAlias
public void setMetaAlias(String metaAlias)
Sets hosted provider's meta alias.- Parameters:
metaAlias- hosted provider's meta alias
-
setRealm
public void setRealm(String realm)
Sets realm.- Parameters:
realm- The realm under which the entity resides.
-
setRemoteEntityId
public void setRemoteEntityId(String remoteId)
Sets remote provider's entity ID.- Parameters:
remoteId- remote provider's entity ID
-
setRemoteDescriptor
public void setRemoteDescriptor(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType remoteDescriptor)
Sets remote provider descriptor. This function is called to give state to the Name registration handler The remote provider identifies the provider who sent a request or with whom registration is to be initiated.- Parameters:
remoteDescriptor- the Remote provider Descriptor
-
setUserID
public void setUserID(String userID)
Sets the UserDN.- Parameters:
userID- the user who is initiating
-
setAccountInfo
public void setAccountInfo(FSAccountFedInfo acctInfo)
Sets the federation account information for the user with a specific remote provider.- Parameters:
acctInfo- the account fed info object
-
setUserDN
public boolean setUserDN(FSNameRegistrationRequest regisRequest)
Determines the user based on the registration request received from a remote provider.- Parameters:
regisRequest- the name registration request- Returns:
truea user is found;falseotherwise.
-
handleNameRegistration
public boolean handleNameRegistration(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object ssoToken)Initiates the name registration operation.- Parameters:
request- HTTP requestresponse- HTTP responsessoToken- corresponding to the user's session- Returns:
- the status of the registration initiation operation.
trueif successful;falseotherwise.
-
handleNameRegistration
public boolean handleNameRegistration(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object ssoToken, HashMap valMap)Handles the name registration after sso.- Parameters:
request- HTTP requestresponse- HTTP responsessoToken- corresponding to the users's session- Returns:
- the status of the registration initiation operation.
trueif successful;falseotherwise.
-
handleRegistrationAfterFederation
public boolean handleRegistrationAfterFederation(String LRURL, jakarta.servlet.http.HttpServletResponse response)
Does local name registration and initiates remote registration with the IDP.- Parameters:
LRURL- the final return URL after Name registration is completeresponse- HTTP response object- Returns:
trueif successful;falseotherwise.
-
processRegistrationResponse
public boolean processRegistrationResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSNameRegistrationResponse regisResponse)Initiates the name registration operation.- Parameters:
request- HTTP requestresponse- HTTP responseregisResponse-FSNameRegistrationResponseobject- Returns:
trueif the operation succeeds;falseotherwise.
-
processRegistrationRequest
public void processRegistrationRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSNameRegistrationRequest regisRequest)Processes the registration request received from a remote provider. Invoded when Http redirect profile is used.- Parameters:
request- HTTP requestresponse- HTTP responseregisRequest- the name registration request received from remote provider
-
processSOAPRegistrationRequest
public FSNameRegistrationResponse processSOAPRegistrationRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSNameRegistrationRequest regisRequest)
Processes the name registration request received from a remote provider. Invoded when SOAP profile is used.- Parameters:
regisRequest- the name registration request received from remote provider
-
returnLocallyAtSource
public void returnLocallyAtSource(jakarta.servlet.http.HttpServletResponse response, boolean isSuccess)Redirects to final destination after registration. Invoked at the end of the registration operation at the end where registration was initiated. The isSuccess determines if a success message or a failure message is displayed.- Parameters:
response-HttpServletResponseobjectisSuccess- determines the content of the registration-done.jsp
-
signRegistrationRequest
protected jakarta.xml.soap.SOAPMessage signRegistrationRequest(jakarta.xml.soap.SOAPMessage msg, String idAttrName, String id) throws SAMLException, FSMsgExceptionSigns the Name registration request before sending it to the IDP.- Parameters:
msg- the request message to be sent to IDPidAttrName- name of the id attribute to be signedid- the value of the id attribute to be signed- Returns:
- signed Name registration request
- Throws:
SAMLExceptionFSMsgException
-
verifyResponseSignature
protected boolean verifyResponseSignature(jakarta.xml.soap.SOAPMessage msg, boolean isIDP)Verifies the Name registration response received from the IDP before processing locally.- Parameters:
msg- the response messageisIDP- whether the remote provider is an IDP or not- Returns:
trueif signature is valid;falseotherwise.
-
-