Package com.esprit.utils
Enum Class SignInMicrosoft
- All Implemented Interfaces:
Serializable
,Comparable<SignInMicrosoft>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
SignInWithMicrosoft
(String... args) Initialize Microsoft Sign-In flowstatic SignInMicrosoft
Returns the enum constant of this class with the specified name.static SignInMicrosoft[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.static boolean
verifyAuthUrl
(String code) Complete the OAuth flow with the authorization code
-
Field Details
-
PROTECTED_RESOURCE_URL
- See Also:
-
LOGGER
-
service
private static com.github.scribejava.core.oauth.OAuth20Service service
-
-
Constructor Details
-
SignInMicrosoft
private SignInMicrosoft()
-
-
Method Details
-
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
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 nameNullPointerException
- 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 errorInterruptedException
- if the operation is interruptedExecutionException
- if the operation failsIllegalStateException
- 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 errorExecutionException
- if the operation failsInterruptedException
- if the operation is interrupted
-