Enum Class SignInGoogle

java.lang.Object
java.lang.Enum<SignInGoogle>
com.esprit.utils.SignInGoogle
All Implemented Interfaces:
Serializable, Comparable<SignInGoogle>, Constable

public enum SignInGoogle extends Enum<SignInGoogle>
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • RANDOM

      private static final SecureRandom RANDOM
    • SECRET_STATE

      private static final String SECRET_STATE
    • PROTECTED_RESOURCE_URL

      private static final String PROTECTED_RESOURCE_URL
      See Also:
    • service

      private static com.github.scribejava.core.oauth.OAuth20Service service
  • Constructor Details

    • SignInGoogle

      private SignInGoogle()
  • Method Details

    • values

      public static SignInGoogle[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SignInGoogle valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • signInWithGoogle

      public static String signInWithGoogle() throws InterruptedException, ExecutionException, IOException
      Initialize Google Sign-In flow
      Returns:
      Authorization URL for the user to visit
      Throws:
      InterruptedException - if the operation is interrupted
      ExecutionException - if the operation fails
      IOException - if there's an I/O error
      IllegalStateException - if required environment variables are missing
    • verifyAuthUrl

      public static boolean verifyAuthUrl(String code) throws IOException, ExecutionException, InterruptedException
      Complete the OAuth flow with the authorization code
      Parameters:
      code - The authorization code from Google
      Returns:
      true if authentication was successful
      Throws:
      IOException - if there's an I/O error
      ExecutionException - if the operation fails
      InterruptedException - if the operation is interrupted