Class CodeVerifier

java.lang.Object
com.nimbusds.oauth2.sdk.auth.Secret
com.nimbusds.oauth2.sdk.pkce.CodeVerifier
All Implemented Interfaces:
Serializable

public class CodeVerifier extends Secret
Authorisation code verifier.

Related specifications:

  • Proof Key for Code Exchange by OAuth Public Clients (RFC 7636).
See Also:
  • Field Details

  • Constructor Details

    • CodeVerifier

      public CodeVerifier(String value)
      Creates a new code verifier with the specified value.
      Parameters:
      value - The code verifier value. Must not contain characters other than [A-Z] / [a-z] / [0-9] / "-" / "." / "_" / "~". The verifier length must be at least 43 characters but not more than 128 characters. Must not be null or empty string.
    • CodeVerifier

      public CodeVerifier()
      Generates a new code verifier represented by a secure random 256-bit number that is Base64URL-encoded (as a 43 character string, which is the minimum character length of a code verifier).
  • Method Details

    • equals

      public boolean equals(Object object)
      Description copied from class: Secret
      Comparison with another secret is constant time, based on the secrets' SHA-256 hashes.
      Overrides:
      equals in class Secret
      Parameters:
      object - The other object. May be null.
      Returns:
      true if both objects are equal, else false.