Package com.sun.identity.saml2.plugins
Class DefaultIDPAdapter
- java.lang.Object
-
- com.sun.identity.saml2.plugins.DefaultIDPAdapter
-
- All Implemented Interfaces:
SAML2IdentityProviderAdapter
public class DefaultIDPAdapter extends Object implements SAML2IdentityProviderAdapter
This classDefaultIDPAdapterimplements a SAML2 Identity Provider Adapter.
-
-
Constructor Summary
Constructors Constructor Description DefaultIDPAdapter()Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize(String hostedEntityID, String realm)Default implementation, takes no action.booleanpreAuthentication(String hostedEntityID, String realm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthnRequest authnRequest, Object session, String reqID, String relayState)Default implementation, takes no action and returns false (no interruption to processing).voidpreSendFailureResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String faultCode, String faultDetail)Default implementation, takes no action.booleanpreSendResponse(AuthnRequest authnRequest, String hostProviderID, String realm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object session, String reqID, String relayState)Default implementation, takes no action and returns false (no interruption to processing).voidpreSignResponse(AuthnRequest authnRequest, Response res, String hostProviderID, String realm, jakarta.servlet.http.HttpServletRequest request, Object session, String relayState)Called after the SAML Response object is created, but before the Response is signed/encrypted.booleanpreSingleSignOn(String hostedEntityID, String realm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthnRequest authnRequest, String reqID)Default implementation, takes no action and returns false (no interruption to processing).
-
-
-
Method Detail
-
initialize
public void initialize(String hostedEntityID, String realm)
Default implementation, takes no action.- Specified by:
initializein interfaceSAML2IdentityProviderAdapter- Parameters:
hostedEntityID- entity ID for the hosted IDPrealm- realm of the hosted IDP
-
preSingleSignOn
public boolean preSingleSignOn(String hostedEntityID, String realm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthnRequest authnRequest, String reqID) throws SAML2Exception
Default implementation, takes no action and returns false (no interruption to processing).- Specified by:
preSingleSignOnin interfaceSAML2IdentityProviderAdapter- Parameters:
hostedEntityID- entity ID for the hosted IDPrealm- realm of the hosted IDPrequest- servlet requestresponse- servlet responseauthnRequest- the original authentication request sent from SPreqID- the id to use for continuation of processing if the adapter redirects- Returns:
- true if browser redirection is happening after processing, false otherwise. Default to false.
- Throws:
SAML2Exception- for any exceptions occurring in the adapter. The federation process will continue.
-
preAuthentication
public boolean preAuthentication(String hostedEntityID, String realm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthnRequest authnRequest, Object session, String reqID, String relayState) throws SAML2Exception
Default implementation, takes no action and returns false (no interruption to processing).- Specified by:
preAuthenticationin interfaceSAML2IdentityProviderAdapter- Parameters:
hostedEntityID- entity ID for the hosted IDPrealm- realm of the hosted IDPrequest- servlet requestresponse- servlet responseauthnRequest- the original authentication request sent from SPsession- the user session or null if the user has no sessionreqID- the id to use for continuation of processing if the adapter redirectsrelayState- the relayState that will be used in the redirect- Returns:
- true if browser redirection is happening after processing, false otherwise. Default to false.
- Throws:
SAML2Exception- for any exceptions occurring in the adapter. The federation process will continue.
-
preSendResponse
public boolean preSendResponse(AuthnRequest authnRequest, String hostProviderID, String realm, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object session, String reqID, String relayState) throws SAML2Exception
Default implementation, takes no action and returns false (no interruption to processing).- Specified by:
preSendResponsein interfaceSAML2IdentityProviderAdapter- Parameters:
authnRequest- original authnrequesthostProviderID- hosted providerID.realm- realm of the hosted IDPrequest- HttpServletRequestresponse- HttpServletResponsesession- the user session or null if the user has no sessionreqID- the id to use for continuation of processing if the adapter redirectsrelayState- the relayState that will be used in the redirect- Returns:
- true if browser redirection happened after processing, false otherwise. Default to false.
- Throws:
SAML2Exception- if error occurs. The federation process will continue.
-
preSendFailureResponse
public void preSendFailureResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String faultCode, String faultDetail) throws SAML2ExceptionDefault implementation, takes no action.- Specified by:
preSendFailureResponsein interfaceSAML2IdentityProviderAdapter- Parameters:
request- HttpServletRequestresponse- HttpServletResponsefaultCode- the fault code that will be returned in the SAML responsefaultDetail- the fault detail that will be returned in the SAML response- Throws:
SAML2Exception- if error occurs. The federation process will continue.
-
preSignResponse
public void preSignResponse(AuthnRequest authnRequest, Response res, String hostProviderID, String realm, jakarta.servlet.http.HttpServletRequest request, Object session, String relayState) throws SAML2Exception
Description copied from interface:SAML2IdentityProviderAdapterCalled after the SAML Response object is created, but before the Response is signed/encrypted. When artifact binding is being used, this method is invoked when the response object is created, and not when the artifact is actually resolved. This extension point's purpose is to make it possible to adjust the content of the SAML response (for example by adding custom SAML extensions), hence this method does not provide a way to abort the SAML flow.- Specified by:
preSignResponsein interfaceSAML2IdentityProviderAdapter- Parameters:
authnRequest- The original SAML Authentication Request (may be null if this was an IdP initiated SSO).res- The SAML Response.hostProviderID- The entity ID of the IdP.realm- The realm the IdP belongs to.request- The HttpServletRequest object.session- The user session or null if the user has no session.relayState- The relayState that will be used in the redirect- Throws:
SAML2Exception- If an error occurs. The federation process will continue.
-
-