Class DPoPUtil

java.lang.Object
org.keycloak.services.util.DPoPUtil

public class DPoPUtil extends Object
Author:
Dmitry Telegin
  • Field Details

  • Constructor Details

    • DPoPUtil

      public DPoPUtil()
  • Method Details

    • getTransientProtocolMapper

      public static Stream<Map.Entry<org.keycloak.models.ProtocolMapperModel,org.keycloak.protocol.ProtocolMapper>> getTransientProtocolMapper()
      creates a protocol mapper that cannot be modified by administration users and that is used to bind AccessTokens to specific DPoP keys.

      NOTE: The binding was solved with a protocol mapper to have generic solution for DPoP on all implemented grantTypes, even custom-implemented grantTypes.
    • handleDPoPHeader

      public static void handleDPoPHeader(org.keycloak.models.KeycloakSession keycloakSession, org.keycloak.events.EventBuilder event, org.keycloak.services.cors.Cors cors, OIDCAdvancedConfigWrapper clientConfig)
      If DPoP feature is enabled and either the client requires it or the current request contains a DPoP header, this method validates the proof and stores it in the session.
    • withDPoPVerifier

      public static org.keycloak.TokenVerifier<org.keycloak.representations.AccessToken> withDPoPVerifier(org.keycloak.TokenVerifier<org.keycloak.representations.AccessToken> verifier, org.keycloak.models.RealmModel realm, DPoPUtil.Validator validator)
    • validateBinding

      public static void validateBinding(org.keycloak.representations.AccessToken token, org.keycloak.representations.dpop.DPoP dPoP) throws org.keycloak.common.VerificationException
      Throws:
      org.keycloak.common.VerificationException
    • validateDPoPJkt

      public static void validateDPoPJkt(String dpopJkt, org.keycloak.models.KeycloakSession session, org.keycloak.events.EventBuilder event, org.keycloak.services.cors.Cors cors)
    • getDPoPSupportedAlgorithms

      public static List<String> getDPoPSupportedAlgorithms(org.keycloak.models.KeycloakSession session)