Enum Class SignInMicrosoft

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

public enum SignInMicrosoft extends Enum<SignInMicrosoft>
  • Field Details

    • PROTECTED_RESOURCE_URL

      private static final String PROTECTED_RESOURCE_URL
      See Also:
    • LOGGER

      private static final Logger LOGGER
    • service

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

    • SignInMicrosoft

      private SignInMicrosoft()
  • Method Details

    • values

      public static SignInMicrosoft[] 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 SignInMicrosoft 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
    • SignInWithMicrosoft

      public static String SignInWithMicrosoft(String... args) throws IOException, InterruptedException, ExecutionException
      Initialize Microsoft Sign-In flow
      Parameters:
      args - Optional arguments (not used)
      Returns:
      Authorization URL for the user to visit
      Throws:
      IOException - if there's an I/O error
      InterruptedException - if the operation is interrupted
      ExecutionException - if the operation fails
      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 Microsoft
      Returns:
      boolean indicating if verification was successful
      Throws:
      IOException - if there's an I/O error
      ExecutionException - if the operation fails
      InterruptedException - if the operation is interrupted