Package org.keycloak.services.util
Class DPoPUtil
java.lang.Object
org.keycloak.services.util.DPoPUtil
- Author:
- Dmitry Telegin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDPoPSupportedAlgorithms(org.keycloak.models.KeycloakSession session) static Stream<Map.Entry<org.keycloak.models.ProtocolMapperModel,org.keycloak.protocol.ProtocolMapper>> creates a protocol mapper that cannot be modified by administration users and that is used to bind AccessTokens to specific DPoP keys.static voidhandleDPoPHeader(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.static voidvalidateBinding(org.keycloak.representations.AccessToken token, org.keycloak.representations.dpop.DPoP dPoP) static voidvalidateDPoPJkt(String dpopJkt, org.keycloak.models.KeycloakSession session, org.keycloak.events.EventBuilder event, org.keycloak.services.cors.Cors cors) 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)
-
Field Details
-
DEFAULT_PROOF_LIFETIME
public static final int DEFAULT_PROOF_LIFETIME- See Also:
-
DEFAULT_ALLOWED_CLOCK_SKEW
public static final int DEFAULT_ALLOWED_CLOCK_SKEW- See Also:
-
DPOP_JKT_TYPE
- See Also:
-
DPOP_TOKEN_TYPE
- See Also:
-
DPOP_SCHEME
- See Also:
-
DPOP_SESSION_ATTRIBUTE
- See Also:
-
DPOP_BINDING_ONLY_REFRESH_TOKEN_SESSION_ATTRIBUTE
- See Also:
-
-
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
-