Interface PkceService


public interface PkceService
Methods used by the PKCE implementation https://datatracker.ietf.org/doc/html/rfc7636
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isExpectedCodeChallengeGenerated(String expectedCodeChallenge, CodeChallengeMethod codeChallengeMethod, String codeVerifier)
    Checks if the expected code challenge is produced by applying the given code challenge method to the given code verifier.
    boolean
    Checks if the given string is a valid PKCE code challenge or PKCE code verifier.
  • Method Details

    • isValidCode

      boolean isValidCode(@Nonnull String input)
      Checks if the given string is a valid PKCE code challenge or PKCE code verifier. This method SHOULD NOT be used on authorization codes. Input must have at least 43 characters. Input must not have more than 128 characters. Input must only contain characters from "a-z"/"A-Z"/"0-9"/"-"/"."/"_"/"~".
      Parameters:
      input - the string to check.
      Returns:
      true if valid.
    • isExpectedCodeChallengeGenerated

      boolean isExpectedCodeChallengeGenerated(@Nonnull String expectedCodeChallenge, @Nonnull CodeChallengeMethod codeChallengeMethod, @Nonnull String codeVerifier)
      Checks if the expected code challenge is produced by applying the given code challenge method to the given code verifier.
      Parameters:
      expectedCodeChallenge - the expected code challenge from applying the transformation
      codeChallengeMethod - the transformation to apply to the code verifier
      codeVerifier - the code verifier
      Returns:
      true if the expected code challenge was produced