All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nimbusds.oauth2.sdk.pkce.CodeChallengeMethod Maven / Gradle / Ivy

Go to download

OAuth 2.0 SDK with OpenID Connection extensions for developing client and server applications.

There is a newer version: 11.21
Show newest version
package com.nimbusds.oauth2.sdk.pkce;


import com.nimbusds.oauth2.sdk.id.Identifier;
import net.jcip.annotations.Immutable;


/**
 * Method that was used to derive an authorisation code challenge.
 *
 * 

Related specifications: * *

    *
  • Proof Key for Code Exchange by OAuth Public Clients (RFC 7636). *
*/ @Immutable public final class CodeChallengeMethod extends Identifier { /** * Plain code challenge method. */ public static final CodeChallengeMethod PLAIN = new CodeChallengeMethod("plain"); /** * SHA-256 code challenge method. */ public static final CodeChallengeMethod S256 = new CodeChallengeMethod("S256"); /** * Gets the default code challenge method. * * @return {@link #PLAIN} */ public static CodeChallengeMethod getDefault() { return PLAIN; } /** * * @param value The code challenge method value. Must not be * {@code null} or empty string. */ public CodeChallengeMethod(final String value) { super(value); } /** * Parses a code challenge method from the specified value. * * @param value The code challenge method value. Must not be * {@code null} or empty string. * * @return The code challenge method. */ public static CodeChallengeMethod parse(final String value) { if (value.equals(PLAIN.getValue())) { return PLAIN; } else if (value.equals(S256.getValue())) { return S256; } else { return new CodeChallengeMethod(value); } } @Override public boolean equals(final Object object) { return object instanceof CodeChallengeMethod && this.toString().equals(object.toString()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy