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<ProtocolMapperModel,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(KeycloakSession keycloakSession, EventBuilder event, 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 TokenVerifier<org.keycloak.representations.AccessToken> withDPoPVerifier(TokenVerifier<org.keycloak.representations.AccessToken> verifier, RealmModel realm, DPoPUtil.Validator validator)
    • validateBinding

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

      public static void validateDPoPJkt(String dpopJkt, KeycloakSession session, EventBuilder event, Cors cors)
    • isDPoPToken

      public static boolean isDPoPToken(org.keycloak.representations.AccessToken refreshToken)
    • getDPoPSupportedAlgorithms

      public static List<String> getDPoPSupportedAlgorithms(KeycloakSession session)