public class MsalRuntimeInterop extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.microsoft.azure.javamsalruntime.ErrorHelper |
ERROR_HELPER |
static MsalRuntimeLibrary |
MSALRUNTIME_LIBRARY |
| Constructor and Description |
|---|
MsalRuntimeInterop() |
| Modifier and Type | Method and Description |
|---|---|
MsalRuntimeFuture |
acquireTokenInteractively(long windowHandle,
AuthParameters authParameters,
String correlationId,
Account account)
Calls MSALRuntime's AcquireTokenInteractively API to retrieve tokens for a given account, by
showing a UI to the user
|
MsalRuntimeFuture |
acquireTokenSilently(AuthParameters authParameters,
String correlationId,
Account account)
Calls MSALRuntime's AcquireTokenSilently API to retrieve tokens for a given account, without
showing a UI to the user
|
static void |
enableLogging(boolean enableLogging)
Sets up the necessary callbacks and handles to integrate MSALRuntime logs into MSAL Java's
logging framework, allowing detailed logs from MSALRuntime's native code to appear in
javamsalruntime's logs
By default, detailed logs from MSALRuntime will not be shown, though some MSALRuntime error
messages may appear as part of a thrown exception
|
static void |
enableLoggingPii(boolean enablePIILogging)
Allows PII data to appear in MSALRuntime error messages and logs
By default, PII logging is disabled
|
MsalRuntimeFuture |
readAccountById(String accountId,
String correlationId)
Retrieves any cached account information for a given account ID
|
static void |
shutdownMsalRuntime()
Calls MSALRuntime's shutdown API
|
MsalRuntimeFuture |
signIn(long windowHandle,
AuthParameters authParameters,
String correlationId,
String loginHint)
Calls MSALRuntime's SignIn API, which will attempt a silent sign in and fall back to
interactive if needed
|
MsalRuntimeFuture |
signInInteractively(long windowHandle,
AuthParameters authParameters,
String correlationId,
String loginHint)
Calls MSALRuntime's SignInInteractively API to attempt a sign in by showing a UI to the user
|
MsalRuntimeFuture |
signInSilently(AuthParameters authParameters,
String correlationId)
Calls MSALRuntime's SignInSilently API to attempt a sign in without showing a UI to the user
|
MsalRuntimeFuture |
signOutSilently(String clientId,
String correlationId,
Account account)
Calls MSALRuntime's SignOut API, which will delete cached tokens for a given account and
require this account to perform a new sign in
|
void |
startupMsalRuntime()
Calls MSALRuntime's startup API
|
public static final MsalRuntimeLibrary MSALRUNTIME_LIBRARY
public static final com.microsoft.azure.javamsalruntime.ErrorHelper ERROR_HELPER
public void startupMsalRuntime()
public static void shutdownMsalRuntime()
Also completes any remaining futures, and performs any necessary cleanup steps to avoid memory leaks
public MsalRuntimeFuture readAccountById(String accountId, String correlationId)
accountId - the ID of the account we will retrieve data forcorrelationId - unique ID used to identify a certain request throughout various
telemetry and logspublic MsalRuntimeFuture signIn(long windowHandle, AuthParameters authParameters, String correlationId, String loginHint)
This API essentially combines the behavior signInSilently and signInInteractively
windowHandle - the parent window handle that will be used to coordinate UI elements
shown to the userauthParameters - a number of parameters to be used in this requestcorrelationId - unique ID used to identify a certain request throughout various
telemetry and logsloginHint - a login hint (such as a username) that may be shown to the userpublic MsalRuntimeFuture signInSilently(AuthParameters authParameters, String correlationId)
authParameters - a number of parameters to be used in this requestcorrelationId - unique ID used to identify a certain request throughout various
telemetry and logspublic MsalRuntimeFuture signInInteractively(long windowHandle, AuthParameters authParameters, String correlationId, String loginHint)
windowHandle - the parent window handle that will be used to coordinate UI elements
shown to the userauthParameters - a number of parameters to be used in this requestcorrelationId - unique ID used to identify a certain request throughout various
telemetry and logsloginHint - a login hint (such as a username) that may be shown to the userpublic MsalRuntimeFuture acquireTokenSilently(AuthParameters authParameters, String correlationId, Account account)
authParameters - a number of parameters to be used in this requestcorrelationId - unique ID used to identify a certain request throughout various
telemetry and logsaccount - a ReadAccountResult instance, which must already be populated with a
ReadAccountResultHandlepublic MsalRuntimeFuture acquireTokenInteractively(long windowHandle, AuthParameters authParameters, String correlationId, Account account)
windowHandle - the parent window handle that will be used to coordinate UI elements
shown to the userauthParameters - a number of parameters to be used in this requestaccount - a ReadAccountResult instance, which must already be populated with a
ReadAccountResultHandlecorrelationId - unique ID used to identify a certain request throughout various
telemetry and logspublic MsalRuntimeFuture signOutSilently(String clientId, String correlationId, Account account)
clientId - client ID used in the call that created the account informationcorrelationId - unique ID used to identify a certain request throughout various
telemetry and logsaccount - an Account object, which must be populated with a valid handlepublic static void enableLogging(boolean enableLogging)
enableLogging - true enables MSALRuntime logging, false disables itpublic static void enableLoggingPii(boolean enablePIILogging)
enablePIILogging - true enables PII logging, false disables itCopyright © 2023. All rights reserved.