Class DefaultSamlArtifactResolver

  • All Implemented Interfaces:
    org.keycloak.protocol.saml.ArtifactResolver, org.keycloak.provider.Provider

    public class DefaultSamlArtifactResolver
    extends Object
    implements org.keycloak.protocol.saml.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 Detail

      • logger

        protected static final org.jboss.logging.Logger logger
    • Constructor Detail

      • DefaultSamlArtifactResolver

        public DefaultSamlArtifactResolver()
    • Method Detail

      • resolveArtifact

        public String resolveArtifact​(org.keycloak.models.AuthenticatedClientSessionModel clientSessionModel,
                                      String artifact)
                               throws org.keycloak.protocol.saml.ArtifactResolverProcessingException
        Specified by:
        resolveArtifact in interface org.keycloak.protocol.saml.ArtifactResolver
        Throws:
        org.keycloak.protocol.saml.ArtifactResolverProcessingException
      • selectSourceClient

        public org.keycloak.models.ClientModel selectSourceClient​(org.keycloak.models.KeycloakSession session,
                                                                  String artifact)
                                                           throws org.keycloak.protocol.saml.ArtifactResolverProcessingException
        Specified by:
        selectSourceClient in interface org.keycloak.protocol.saml.ArtifactResolver
        Throws:
        org.keycloak.protocol.saml.ArtifactResolverProcessingException
      • buildArtifact

        public String buildArtifact​(org.keycloak.models.AuthenticatedClientSessionModel clientSessionModel,
                                    String entityId,
                                    String artifactResponse)
                             throws org.keycloak.protocol.saml.ArtifactResolverProcessingException
        Specified by:
        buildArtifact in interface org.keycloak.protocol.saml.ArtifactResolver
        Throws:
        org.keycloak.protocol.saml.ArtifactResolverProcessingException
      • createArtifact

        public String createArtifact​(String entityId)
                              throws org.keycloak.protocol.saml.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:
        org.keycloak.protocol.saml.ArtifactResolverProcessingException
      • close

        public void close()
        Specified by:
        close in interface org.keycloak.provider.Provider