You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Microsoft Authentication Library for Java (MSAL4J) enables applications to integrate with the [Microsoft identity platform](https://docs.microsoft.com/en-us/azure/active-directory/develop/). It allows you to sign in users or apps with Microsoft identities (Azure AD, Microsoft accounts and Azure AD B2C accounts) and obtain tokens to call Microsoft APIs such as [Microsoft Graph](https://graph.microsoft.io/) or your own APIs registered with the Microsoft identity platform. It is built using industry standard OAuth2 and OpenID Connect protocols.
8
8
@@ -16,9 +16,9 @@ Quick links:
16
16
The library supports the following Java environments:
17
17
- Java 8 (or higher)
18
18
19
-
Current version - 1.13.2
19
+
Current version - 1.13.8
20
20
21
-
You can find the changes for each version in the [change log](https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/master/changelog.txt).
21
+
You can find the changes for each version in the [change log](https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/main/msal4j-sdk/changelog.txt).
22
22
23
23
You can get the com.microsoft.aad.msal4j package through Maven or Gradle.
24
24
@@ -28,13 +28,13 @@ Find [the latest package in the Maven repository](https://mvnrepository.com/arti
@@ -163,17 +182,55 @@ public void removeAccount(PublicClientApplication application, IAccount msalJava
163
182
*/
164
183
@Override
165
184
publicbooleanisBrokerAvailable() {
166
-
try {
167
-
interop.startupMsalRuntime();
185
+
//brokerAvailable is only set after the first attempt to call MSALRuntime's startup API
186
+
if (brokerAvailable == null) {
187
+
try {
188
+
interop.startupMsalRuntime();
168
189
169
-
LOG.info("MSALRuntime started successfully. MSAL Java will use MSALRuntime in all supported broker flows.");
190
+
LOG.info("MSALRuntime started successfully. MSAL Java will use MSALRuntime in all supported broker flows.");
170
191
171
-
returntrue;
172
-
} catch (MsalInteropExceptione) {
173
-
LOG.warn("Exception thrown when trying to start MSALRuntime: {}", e.getErrorMessage());
174
-
LOG.warn("MSALRuntime could not be started. MSAL Java will fall back to non-broker flows.");
192
+
brokerAvailable =true;
193
+
} catch (MsalInteropExceptione) {
194
+
LOG.warn("Exception thrown when trying to start MSALRuntime: {}", e.getErrorMessage());
195
+
LOG.warn("MSALRuntime could not be started. MSAL Java will fall back to non-broker flows.");
175
196
176
-
returnfalse;
197
+
brokerAvailable = false;
198
+
}
199
+
}
200
+
201
+
returnbrokerAvailable;
202
+
}
203
+
204
+
/**
205
+
* Toggles whether or not detailed MSALRuntime logs will appear in MSAL Java's normal logging framework.
206
+
*
207
+
* If enabled, you will see logs directly from MSALRuntime, containing verbose information relating to telemetry, API calls,successful/failed requests, and more.
208
+
* These logs will appear alongside MSAL Java's logs (with a message indicating they came from MSALRuntime), and will follow the same log level as MSAL Java's logs (info/debug/error/etc.).
209
+
*
210
+
* If disabled (default), MSAL Java will still produce some logs related to MSALRuntime, particularly in error messages, but will be much less verbose.
211
+
*
212
+
* @param enableLogging true to enable MSALRuntime logs, false to disable it
0 commit comments