Package org.keycloak.protocol.saml
Class DefaultSamlArtifactResolver
- java.lang.Object
-
- org.keycloak.protocol.saml.DefaultSamlArtifactResolver
-
- All Implemented Interfaces:
ArtifactResolver
,Provider
public class DefaultSamlArtifactResolver extends Object implements ArtifactResolver
ArtifactResolver for artifact-04 format. Other kind of format for artifact are allowed by standard but not specified. Artifact 04 is the only one specified in SAML2.0 specification.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.jboss.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description DefaultSamlArtifactResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
buildArtifact(AuthenticatedClientSessionModel clientSessionModel, String entityId, String artifactResponse)
Creates and stores an artifactvoid
close()
String
createArtifact(String entityId)
Creates an artifact.String
resolveArtifact(AuthenticatedClientSessionModel clientSessionModel, String artifact)
Returns a serialized Saml ArtifactResponse corresponding to the artifact that was created bybuildArtifact
ClientModel
selectSourceClient(KeycloakSession session, String artifact)
Returns client model that issued artifact
-
-
-
Method Detail
-
resolveArtifact
public String resolveArtifact(AuthenticatedClientSessionModel clientSessionModel, String artifact) throws ArtifactResolverProcessingException
Description copied from interface:ArtifactResolver
Returns a serialized Saml ArtifactResponse corresponding to the artifact that was created bybuildArtifact
- Specified by:
resolveArtifact
in interfaceArtifactResolver
- Parameters:
clientSessionModel
- client session model that can be used for obtaining the artifact responseartifact
- the artifact- Returns:
- serialized Saml ArtifactResponse corresponding to the artifact
- Throws:
ArtifactResolverProcessingException
- When an error occurs during resolution of the artifact.
-
selectSourceClient
public ClientModel selectSourceClient(KeycloakSession session, String artifact) throws ArtifactResolverProcessingException
Description copied from interface:ArtifactResolver
Returns client model that issued artifact- Specified by:
selectSourceClient
in interfaceArtifactResolver
- Parameters:
session
- KeycloakSession for searching for client corresponding clientartifact
- the artifact- Returns:
- the client model that issued the artifact
- Throws:
ArtifactResolverProcessingException
- When an error occurs during client search
-
buildArtifact
public String buildArtifact(AuthenticatedClientSessionModel clientSessionModel, String entityId, String artifactResponse) throws ArtifactResolverProcessingException
Description copied from interface:ArtifactResolver
Creates and stores an artifact- Specified by:
buildArtifact
in interfaceArtifactResolver
- Parameters:
clientSessionModel
- client session model that can be used for storing the response for artifactentityId
- id of an issuer that issued the artifactResponseartifactResponse
- serialized Saml ArtifactResponse that represents the response for created artifact- Returns:
- the artifact
- Throws:
ArtifactResolverProcessingException
- When an error occurs during creation of the artifact.
-
createArtifact
public String createArtifact(String entityId) throws ArtifactResolverProcessingException
Creates an artifact. Format is:SAML_artifact := B64(TypeCode EndpointIndex RemainingArtifact)
TypeCode := 0x0004 EndpointIndex := Byte1Byte2 RemainingArtifact := SourceID MessageHandle
SourceID := 20-byte_sequence, used by the artifact receiver to determine artifact issuer MessageHandle := 20-byte_sequence
- Parameters:
entityId
- the entity id to encode in the sourceId- Returns:
- an artifact
- Throws:
ArtifactResolverProcessingException
-
-