Class FSSSOAndFedHandler
- java.lang.Object
-
- com.sun.identity.federation.services.fednsso.FSSSOAndFedHandler
-
- Direct Known Subclasses:
FSProxyHandler,FSSSOBrowserArtifactProfileHandler,FSSSOBrowserPostProfileHandler,FSSSOLECPProfileHandler,FSSSOWMLPostProfileHandler
public abstract class FSSSOAndFedHandler extends Object
Base class forIDPside handler that handles single sign on and federation requests.
-
-
Field Summary
Fields Modifier and Type Field Description protected FSAccountManageraccountManagerprotected FSAuthnRequestauthnRequestprotected com.sun.identity.federation.jaxb.entityconfig.BaseConfigTypehostedConfigprotected com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorTypehostedDescprotected StringhostedEntityIdprotected StringmetaAliasprotected static IDFFMetaManagermetaManagerprotected StatusnoFedStatusprotected Stringrealmprotected StringrelayStateprotected jakarta.servlet.http.HttpServletRequestrequestprotected jakarta.servlet.http.HttpServletResponseresponseprotected com.sun.identity.federation.jaxb.entityconfig.BaseConfigTypespConfigprotected com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorTypespDescriptorprotected StringspEntityIdprotected ObjectssoToken
-
Constructor Summary
Constructors Modifier Constructor Description protectedFSSSOAndFedHandler()Default constructor.FSSSOAndFedHandler(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Constructor.FSSSOAndFedHandler(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSAuthnRequest authnRequest, com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType spConfig, String spEntityId, String relayState)Constructor.FSSSOAndFedHandler(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSAuthnRequest authnRequest, com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType spConfig, String spEntityId, String relayState, Object ssoToken)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcleanMetaAlias(jakarta.servlet.http.HttpServletRequest request)Removes meta alias from request parameters.protected FSAuthnResponsecreateAuthnResponse(Object ssoToken, String inResponseTo, NameIdentifier userHandle, NameIdentifier idpHandle)protected FSAccountFedInfodoAccountFederation(Object ssoToken, FSAuthnRequest authnRequest, FSSession session)protected booleandoSingleSignOn(Object ssoToken, String inResponseTo)protected booleandoSingleSignOn(Object ssoToken, String inResponseTo, NameIdentifier spHandle, NameIdentifier idpHandle)StringformatLoginURL(String loginUrl, String authnContext)Generates local login url.StringgetHostedEntityId()Gets hosted provider id.com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorTypegetProvider()Returns remoteSPprovider descriptor.StringgetRealm()Gets the realm under which the entity resides.protected booleanisIDPProxyEnabled(FSAuthnRequest authnRequest)Checks if the identity provider is configured for proxying the authentication requests for a requesting service provider.voidprocessAuthnRequest(FSAuthnRequest authnRequest, boolean bPostAuthn)Processes authentication request.booleanprocessPostAuthnSSO(FSAuthnRequest authnRequest)Handles authentication request after local login.booleanprocessPreAuthnSSO(FSAuthnRequest authnRequest)Handles authentication request.FSResponseprocessSAMLRequest(FSSAMLRequest samlRequest)ProcessesSAMLrequest.protected voidreturnErrorResponse()protected voidsendAuthnResponse(FSAuthnResponse authnResponse)protected voidsendProxyAuthnRequest(FSAuthnRequest authnRequest, String preferredIDP)Sends a new AuthnRequest to the authenticating provider.voidsetHostedDescriptor(com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorType hostedDesc)Sets host identity provider's meta descriptor.voidsetHostedDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)Sets host identity provider's extended meta.voidsetHostedEntityId(String hostedEntityId)Sets host identity provider's entity ID.voidsetMetaAlias(String metaAlias)Sets meta alias of the host identity provider.voidsetRealm(String realm)Sets the realm under which the entity resides.voidsetSPDescriptor(com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor)Sets remoteSPprovider descriptor.protected booleanverifyRequestSignature(FSAuthnRequest authnRequest)
-
-
-
Field Detail
-
metaManager
protected static IDFFMetaManager metaManager
-
request
protected jakarta.servlet.http.HttpServletRequest request
-
response
protected jakarta.servlet.http.HttpServletResponse response
-
spDescriptor
protected com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor
-
spConfig
protected com.sun.identity.federation.jaxb.entityconfig.BaseConfigType spConfig
-
spEntityId
protected String spEntityId
-
relayState
protected String relayState
-
authnRequest
protected FSAuthnRequest authnRequest
-
ssoToken
protected Object ssoToken
-
metaAlias
protected String metaAlias
-
hostedDesc
protected com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorType hostedDesc
-
hostedConfig
protected com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig
-
realm
protected String realm
-
hostedEntityId
protected String hostedEntityId
-
noFedStatus
protected Status noFedStatus
-
accountManager
protected FSAccountManager accountManager
-
-
Constructor Detail
-
FSSSOAndFedHandler
protected FSSSOAndFedHandler()
Default constructor.
-
FSSSOAndFedHandler
public FSSSOAndFedHandler(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSAuthnRequest authnRequest, com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType spConfig, String spEntityId, String relayState, Object ssoToken)Constructor.- Parameters:
request-HttpServletRequestobjectresponse-HttpServletResponseobjectauthnRequest- authentication requestspDescriptor-SP's provider descriptorspConfig-SP's provider extended metaspEntityId-SP's entity idrelayState- where to go after single sign on is donessoToken- token of the user to be single sign-oned
-
FSSSOAndFedHandler
public FSSSOAndFedHandler(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, FSAuthnRequest authnRequest, com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor, com.sun.identity.federation.jaxb.entityconfig.BaseConfigType spConfig, String spEntityId, String relayState)Constructor.- Parameters:
request-HttpServletRequestobjectresponse-HttpServletResponseobjectauthnRequest- authentication requestspDescriptor-SP's provider descriptorspConfig-SP's extended metaspEntityId-SP's entity idrelayState- where to go after single sign on is done
-
FSSSOAndFedHandler
public FSSSOAndFedHandler(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Constructor.- Parameters:
request-HttpServletRequestobjectresponse-HttpServletResponseobject
-
-
Method Detail
-
setMetaAlias
public void setMetaAlias(String metaAlias)
Sets meta alias of the host identity provider.- Parameters:
metaAlias- meta alias of the provider.
-
setHostedEntityId
public void setHostedEntityId(String hostedEntityId)
Sets host identity provider's entity ID.- Parameters:
hostedEntityId- entity ID to be set- See Also:
getHostedEntityId()
-
setHostedDescriptor
public void setHostedDescriptor(com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorType hostedDesc)
Sets host identity provider's meta descriptor.- Parameters:
hostedDesc- hosted meta descriptor to be set
-
setHostedDescriptorConfig
public void setHostedDescriptorConfig(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
Sets host identity provider's extended meta.- Parameters:
hostedConfig- host identity provider's extended meta to be set
-
getHostedEntityId
public String getHostedEntityId()
Gets hosted provider id.- Returns:
- hosted provider id.
- See Also:
setHostedEntityId(String)
-
getRealm
public String getRealm()
Gets the realm under which the entity resides.- Returns:
- the realm under which the entity resides.
- See Also:
setRealm(String)
-
setRealm
public void setRealm(String realm)
Sets the realm under which the entity resides.- Parameters:
realm- The realm under which the entity resides.- See Also:
getRealm()
-
processPreAuthnSSO
public boolean processPreAuthnSSO(FSAuthnRequest authnRequest)
Handles authentication request.- Parameters:
authnRequest-FSAuthnRequestobject- Returns:
trueif the request is handled successfully;falseotherwise.
-
formatLoginURL
public String formatLoginURL(String loginUrl, String authnContext)
Generates local login url.- Parameters:
loginUrl- authentication base urlauthnContext- requestedAuthnContextRef- Returns:
- local login url with appropriate parameters
-
processPostAuthnSSO
public boolean processPostAuthnSSO(FSAuthnRequest authnRequest)
Handles authentication request after local login.- Parameters:
authnRequest-FSAuthnRequestobject- Returns:
trueif the request is handled successfully;falseotherwise.
-
createAuthnResponse
protected FSAuthnResponse createAuthnResponse(Object ssoToken, String inResponseTo, NameIdentifier userHandle, NameIdentifier idpHandle)
-
doSingleSignOn
protected boolean doSingleSignOn(Object ssoToken, String inResponseTo, NameIdentifier spHandle, NameIdentifier idpHandle)
-
doAccountFederation
protected FSAccountFedInfo doAccountFederation(Object ssoToken, FSAuthnRequest authnRequest, FSSession session)
-
returnErrorResponse
protected void returnErrorResponse()
-
processSAMLRequest
public FSResponse processSAMLRequest(FSSAMLRequest samlRequest)
ProcessesSAMLrequest.- Parameters:
samlRequest-FSSAMLRequestobject- Returns:
- generated
FSResponseobject
-
processAuthnRequest
public void processAuthnRequest(FSAuthnRequest authnRequest, boolean bPostAuthn)
Processes authentication request.- Parameters:
authnRequest- authentication requestbPostAuthn-trueindicates it's post authentication;falseindicates it's pre authentication.
-
sendAuthnResponse
protected void sendAuthnResponse(FSAuthnResponse authnResponse)
-
setSPDescriptor
public void setSPDescriptor(com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType spDescriptor)
Sets remoteSPprovider descriptor.- Parameters:
spDescriptor- remoteSPprovider descriptor.- See Also:
getProvider()
-
getProvider
public com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType getProvider()
Returns remoteSPprovider descriptor.- Returns:
- remote
SPprovider descriptor
-
verifyRequestSignature
protected boolean verifyRequestSignature(FSAuthnRequest authnRequest)
-
cleanMetaAlias
public static String cleanMetaAlias(jakarta.servlet.http.HttpServletRequest request)
Removes meta alias from request parameters.- Parameters:
request-HttpServletRequestobject- Returns:
- parameter string which doesn't contain meta alias
-
sendProxyAuthnRequest
protected void sendProxyAuthnRequest(FSAuthnRequest authnRequest, String preferredIDP) throws FSException, IOException
Sends a new AuthnRequest to the authenticating provider.- Parameters:
authnRequest- original AuthnRequest sent by the service provider.preferredIDP- IDP to be proxied.- Throws:
FSException- for any federation failure.IOException- if there is a failure in redirection.
-
isIDPProxyEnabled
protected boolean isIDPProxyEnabled(FSAuthnRequest authnRequest) throws FSException
Checks if the identity provider is configured for proxying the authentication requests for a requesting service provider.- Parameters:
authnRequest- Authentication Request.- Returns:
trueif the IDP is configured for proxying.- Throws:
FSException- for any failure.
-
-