Package org.keycloak.protocol.saml
Class SamlService.BindingProtocol
java.lang.Object
org.keycloak.protocol.saml.SamlService.BindingProtocol
- Direct Known Subclasses:
SamlService.PostBindingProtocol,SamlService.RedirectBindingProtocol
- Enclosing class:
- SamlService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.ws.rs.core.ResponsebasicChecks(String samlRequest, String samlResponse, String artifact) protected abstract booleancontainsUnencryptedSignature(org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder documentHolder) protected abstract StringencodeSamlDocument(Document samlDocument) protected abstract jakarta.ws.rs.core.Responseerror(org.keycloak.models.KeycloakSession session, org.keycloak.sessions.AuthenticationSessionModel authenticationSession, jakarta.ws.rs.core.Response.Status status, String message, Object... parameters) voidexecute(jakarta.ws.rs.container.AsyncResponse asyncReponse, String samlRequest, String samlResponse, String relayState, String artifact) jakarta.ws.rs.core.Responseprotected abstract org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolderextractRequestDocument(String samlRequest) protected abstract org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolderextractResponseDocument(String response) protected abstract Stringprotected StringgetBindingType(org.keycloak.dom.saml.v2.protocol.AuthnRequestType requestAbstractType) protected URIgetExpectedDestinationUri(org.keycloak.models.KeycloakSession session) KEYCLOAK-12616, KEYCLOAK-12944: construct the expected destination URI using the configured base URI.protected voidhandleArtifact(jakarta.ws.rs.container.AsyncResponse asyncResponse, String artifact, String relayState) Handle a received artifact message.protected jakarta.ws.rs.core.ResponsehandleSamlRequest(String samlRequest, String relayState) protected jakarta.ws.rs.core.ResponsehandleSamlResponse(String samlResponse, String relayState) protected booleanprotected jakarta.ws.rs.core.ResponseloginRequest(String relayState, org.keycloak.dom.saml.v2.protocol.AuthnRequestType requestAbstractType, org.keycloak.models.ClientModel client) protected jakarta.ws.rs.core.ResponselogoutRequest(org.keycloak.dom.saml.v2.protocol.LogoutRequestType logoutRequest, org.keycloak.models.ClientModel client, String relayState) protected jakarta.ws.rs.core.ResponsesendProtocolError(org.keycloak.sessions.AuthenticationSessionModel authSession, org.keycloak.protocol.LoginProtocol.Error error, String errorMessage) protected jakarta.ws.rs.core.ResponsetriggerSamlEvent(org.keycloak.services.clientpolicy.ClientPolicyContext ctx) protected abstract voidverifySignature(org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder documentHolder, org.keycloak.models.ClientModel client)
-
Field Details
-
redirectToAuthentication
protected boolean redirectToAuthentication
-
-
Constructor Details
-
BindingProtocol
public BindingProtocol()
-
-
Method Details
-
error
-
sendProtocolError
protected jakarta.ws.rs.core.Response sendProtocolError(org.keycloak.sessions.AuthenticationSessionModel authSession, org.keycloak.protocol.LoginProtocol.Error error, String errorMessage) -
basicChecks
-
isDestinationRequired
protected boolean isDestinationRequired() -
handleSamlResponse
-
triggerSamlEvent
protected jakarta.ws.rs.core.Response triggerSamlEvent(org.keycloak.services.clientpolicy.ClientPolicyContext ctx) -
handleSamlRequest
-
handleArtifact
protected void handleArtifact(jakarta.ws.rs.container.AsyncResponse asyncResponse, String artifact, String relayState) Handle a received artifact message. This means finding the client based on the content of the artifact, sending an ArtifactResolve, receiving an ArtifactResponse, and handling its content based on the "standard" workflows.- Parameters:
artifact- the received artifactrelayState- the current relay state
-
encodeSamlDocument
protected abstract String encodeSamlDocument(Document samlDocument) throws org.keycloak.saml.common.exceptions.ProcessingException - Throws:
org.keycloak.saml.common.exceptions.ProcessingException
-
verifySignature
protected abstract void verifySignature(org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder documentHolder, org.keycloak.models.ClientModel client) throws org.keycloak.common.VerificationException - Throws:
org.keycloak.common.VerificationException
-
containsUnencryptedSignature
protected abstract boolean containsUnencryptedSignature(org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder documentHolder) -
extractRequestDocument
protected abstract org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder extractRequestDocument(String samlRequest) -
extractResponseDocument
protected abstract org.keycloak.saml.processing.core.saml.v2.common.SAMLDocumentHolder extractResponseDocument(String response) -
loginRequest
protected jakarta.ws.rs.core.Response loginRequest(String relayState, org.keycloak.dom.saml.v2.protocol.AuthnRequestType requestAbstractType, org.keycloak.models.ClientModel client) -
getBindingType
protected String getBindingType(org.keycloak.dom.saml.v2.protocol.AuthnRequestType requestAbstractType) -
getBindingType
-
logoutRequest
protected jakarta.ws.rs.core.Response logoutRequest(org.keycloak.dom.saml.v2.protocol.LogoutRequestType logoutRequest, org.keycloak.models.ClientModel client, String relayState) -
execute
-
execute
-
getExpectedDestinationUri
KEYCLOAK-12616, KEYCLOAK-12944: construct the expected destination URI using the configured base URI.- Parameters:
session- a reference to theKeycloakSession.- Returns:
- the constructed
URI.
-