public class IDPProxyUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addRequesterIDToScope(Scoping scoping,
String requesterId) |
static void |
generateProxyResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PrintWriter out,
String metaAlias,
ResponseInfo respInfo,
Object newSession,
SAML2EventLogger auditor)
Generates the AuthnResponse by the IDP Proxy and send to the service provider.
|
static String |
getLocation(String realm,
String idpEntityID,
String binding)
Gets the SLO response service location of the authenticating
identity provider
|
static String |
getPreferredIDP(AuthnRequest authnRequest,
String hostedEntityId,
String realm,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Gets the preferred IDP Id to be proxied.
|
static List |
getSessionPartners(javax.servlet.http.HttpServletRequest request) |
static Map |
getSessionPartners(SOAPMessage message) |
static List |
getSPSessionPartners(javax.servlet.http.HttpServletRequest request) |
static void |
initiateSPLogoutRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PrintWriter out,
String partner,
String spMetaAlias,
String realm,
LogoutRequest logoutReq,
SOAPMessage msg,
IDPSession idpSession,
String binding,
String relayState)
Initiates the Single logout request by the IDP Proxy to the
authenticating identity provider.
|
static boolean |
isIDPProxyEnabled(AuthnRequest authnRequest,
String realm)
Checks if the identity provider is configured for proxying the
authentication requests for a requesting service provider.
|
static boolean |
isIDPProxyEnabled(String requestID)
Checks if the proxying is enabled.
|
static void |
sendIDPInitProxyLogoutRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PrintWriter out,
LogoutResponse logoutResponse,
String location,
String spEntityID,
String idpEntityID,
String binding,
String realm) |
static void |
sendProxyAuthnRequest(AuthnRequest authnRequest,
String preferredIDP,
SPSSODescriptorElement spSSODescriptor,
String hostedEntityId,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String realm,
String relayState,
String originalBinding)
Sends a new AuthnRequest to the authenticating provider.
|
static void |
sendProxyLogoutRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PrintWriter out,
LogoutRequest logoutReq,
List partners,
String binding,
String relayState) |
static void |
sendProxyLogoutRequestSOAP(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PrintWriter out,
SOAPMessage msg,
List partners,
IDPSession idpSession) |
static void |
sendProxyLogoutResponse(javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpServletRequest request,
String originatingRequestID,
Map<String,String> infoMap,
String remoteEntity,
String binding) |
static void |
sendProxyLogoutResponseBySOAP(SOAPMessage reply,
javax.servlet.http.HttpServletResponse resp,
PrintWriter out) |
static void |
sendResponseWithStatus(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PrintWriter out,
String requestID,
String idpMetaAlias,
String hostEntityID,
String realm,
String firstlevelStatusCodeValue,
String secondlevelStatusCodeValue)
Sends back response with firstlevel and secondlevel status code if available for the original AuthnRequest.
|
public static String getPreferredIDP(AuthnRequest authnRequest, String hostedEntityId, String realm, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws SAML2Exception
authnRequest
- original Authn Request.hostedEntityId
- hosted provider IDrealm
- Realmrequest
- HttpServletRequestresponse
- HttpServletResponseSAML2Exception
- for any SAML2 failure.public static void sendProxyAuthnRequest(AuthnRequest authnRequest, String preferredIDP, SPSSODescriptorElement spSSODescriptor, String hostedEntityId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String realm, String relayState, String originalBinding) throws SAML2Exception, IOException
authnRequest
- original AuthnRequest sent by the service provider.preferredIDP
- IDP to be proxied.spSSODescriptor
- SPSSO Descriptor ElementhostedEntityId
- hosted provider IDrequest
- HttpServletRequestresponse
- HttpServletResponserealm
- RealmrelayState
- the Relay StateoriginalBinding
- The binding used to send the original AuthnRequest.SAML2Exception
- for any SAML2 failure.IOException
- if there is a failure in redirection.public static void addRequesterIDToScope(Scoping scoping, String requesterId) throws SAML2Exception
SAML2Exception
public static boolean isIDPProxyEnabled(AuthnRequest authnRequest, String realm) throws SAML2Exception
authnRequest
- Authentication Request.realm
- Realmtrue
if the IDP is configured for proxying.SAML2Exception
- for any failure.public static boolean isIDPProxyEnabled(String requestID)
requestID
- authentication request id which is created by the
proxying IDP to the authenticating IDP.public static void sendResponseWithStatus(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PrintWriter out, String requestID, String idpMetaAlias, String hostEntityID, String realm, String firstlevelStatusCodeValue, String secondlevelStatusCodeValue) throws SAML2Exception
request
- The request.response
- The response.out
- The print writer for writing out presentation.requestID
- The requestID of the proxied AuthnRequest.idpMetaAlias
- The IdP's metaAlias.hostEntityID
- The IdP's entity ID.realm
- The realm where the IdP belongs to.firstlevelStatusCodeValue
- First-level status code value passed.secondlevelStatusCodeValue
- Second-level status code value passed.SAML2Exception
- If there was an error while sending the response with second-level status-code.public static void generateProxyResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PrintWriter out, String metaAlias, ResponseInfo respInfo, Object newSession, SAML2EventLogger auditor) throws SAML2Exception
request
- HttpServletRequest The HTTP request.response
- HttpServletResponse The HTTP response.out
- The print writer for writing out presentation.metaAlias
- The meta alias.respInfo
- ResponseInfo object.newSession
- Session object.auditor
- a SAML2EventLogger
auditorSAML2Exception
- for any SAML2 failure.public static void initiateSPLogoutRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PrintWriter out, String partner, String spMetaAlias, String realm, LogoutRequest logoutReq, SOAPMessage msg, IDPSession idpSession, String binding, String relayState)
request
- HttpServletRequestresponse
- HttpServletResponseout
- The print writer for writing out presentation.partner
- Authenticating identity providerspMetaAlias
- IDP proxy's meta alias acting as SPrealm
- Realmpublic static String getLocation(String realm, String idpEntityID, String binding)
realm
- RealmidpEntityID
- authenticating identity provider.public static List getSessionPartners(javax.servlet.http.HttpServletRequest request)
public static void sendProxyLogoutRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PrintWriter out, LogoutRequest logoutReq, List partners, String binding, String relayState)
public static void sendProxyLogoutResponse(javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServletRequest request, String originatingRequestID, Map<String,String> infoMap, String remoteEntity, String binding) throws SAML2Exception
SAML2Exception
public static void sendProxyLogoutRequestSOAP(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PrintWriter out, SOAPMessage msg, List partners, IDPSession idpSession)
public static Map getSessionPartners(SOAPMessage message)
public static void sendProxyLogoutResponseBySOAP(SOAPMessage reply, javax.servlet.http.HttpServletResponse resp, PrintWriter out)
public static void sendIDPInitProxyLogoutRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, PrintWriter out, LogoutResponse logoutResponse, String location, String spEntityID, String idpEntityID, String binding, String realm) throws SAML2Exception
SAML2Exception
public static List getSPSessionPartners(javax.servlet.http.HttpServletRequest request)
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.