Package com.iizix.server.oauth.services
Class Microsoft
java.lang.Object
com.iizix.server.oauth.AbstractOAuthService
com.iizix.server.oauth.services.Microsoft
- All Implemented Interfaces:
- IOAuthService
Microsoft identity platform service can be used for a specific tenant or the default "common" tentant.
- Field SummaryFieldsModifier and TypeFieldDescription- static final StringThe Open ID scope: "openid".- static final StringThe User Read Public Profile scope: "User.Read".- Fields inherited from class com.iizix.server.oauth.AbstractOAuthService- ACCEPT_LANGUAGE, accessToken, service1, service2, session
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescriptionGets the approximate size in pixels of the inner browser window requested.Gets authentication provider.Returns the logout URL for the OAuth service.Gets the UserProfileInformation from this service.- static IServiceCreator- <Microsoft> - initialize- (String tenant, String clientID, String clientSecret, String... scopes) Creates an instance of the- ParamInitializedServicethat holds the parameters for the provider authentication.- Methods inherited from class com.iizix.server.oauth.AbstractOAuthService- createServiceBuilder, dispose, disposeBlocked, disposeUserCancel, doAuthenticate, getAccessToken, getAccessToken1, getAccessToken2, getDebugOutputStream, getRequestAdditionalTime, invalidateAccessToken, validate- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait- Methods inherited from interface com.iizix.comm.oauth.IOAuthService- getServiceName
- Field Details- SCOPE_user_readThe User Read Public Profile scope: "User.Read".- See Also:
 
- SCOPE_openidThe Open ID scope: "openid".- See Also:
 
 
- Constructor Details- Microsoftpublic Microsoft- (OAuthSession session, String tenant, String clientID, String clientSecret, String... scopes) Constructs the service.- Parameters:
- session- The OAuthSession.
- tenant- The tenant in Microsoft Azure, formatted as "12345abc-12ab-34cd-56ef-012345abcdef",- nullor "common" or empty string for the "common" tenant.
- clientID- The Client ID, formatted as "12345abc-12ab-34cd-56ef-012345abcdef".
- clientSecret- The Client Secret, formatted as "ABab0_1uxyTv-O.aQwERTY_12abCDeF_7_".
- scopes- The list of scopes as an array, or none for default scopes:In order to retrieve the user profile information using- {@link #getUserProfileInfo()}, you MUST either leave scopes empty or specify the scopes- {@link #SCOPE_user_read}.
- Throws:
- NullPointerException- If- clientID,- clientSecretor any of the- scopesvalues are null is- null.
- IllegalArgumentException- If- clientID,- clientSecretor any of the- scopesvalues is empty.
- IllegalStateException- If the authentication engine is not initialized.
 
 
- Method Details- initializepublic static IServiceCreator<Microsoft> initialize- (String tenant, String clientID, String clientSecret, String... scopes) Creates an instance of the- ParamInitializedServicethat holds the parameters for the provider authentication.- Parameters:
- tenant- The tenant in Microsoft Azure, formatted as "12345abc-12ab-34cd-56ef-012345abcdef",- nullor "common" or empty string for the "common" tenant.
- clientID- The Client ID, formatted as "12345abc-12ab-34cd-56ef-012345abcdef".
- clientSecret- The Client Secret, formatted as "ABab0_1uxyTv-O.aQwERTY_12abCDeF_7_".
- scopes- The list of scopes as an array, or none for default scopes:In order to retrieve the user profile information using- {@link #getUserProfileInfo()}, you MUST either leave scopes empty or specify the scopes- {@link #SCOPE_user_read}.
- Throws:
- NullPointerException- If- clientID,- clientSecretor any of the- scopesvalues are null is- null.
- IllegalArgumentException- If- clientID,- clientSecretor any of the- scopesvalues is empty.
 
- getAuthenticationProviderGets authentication provider.- Returns:
- The authentication provider enum AuthenticationProvider.Microsoft.
 
- getApproximateSizeGets the approximate size in pixels of the inner browser window requested. This setting used when possible, but is not guaranteed.- Returns:
- The size, or null if none is known (full screen).
 
- getLogoutURLReturns the logout URL for the OAuth service. It is not the same as invalidating an access URL.- Specified by:
- getLogoutURLin class- AbstractOAuthService
- Returns:
- The logout URL is nullfor none.
 
- getUserProfileInfopublic UserProfileInfo getUserProfileInfo() throws IOException, InterruptedException, ExecutionExceptionGets the UserProfileInformation from this service.- This will cause the user to have to authenticate with the service, unless not already done. - All fields available for this service that are possible to set and available will be initialized. Other values will be left - null, unknown or undefined.- Specified by:
- getUserProfileInfoin class- AbstractOAuthService
- Returns:
- The UserProfileInfo instance.
- Throws:
- IllegalStateException- If the authentication has not completed successfully, or if the String- "profile"is not among the requested scopes.
- ExecutionException- For execution errors.
- InterruptedException- If the revocation action was interrupted.
- IOException- For I/O errors.