Skip to content
3 changes: 2 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
vNext
----------
- [MINOR] Use SharedPreferencesInMemoryCache implementation in Broker (#2802)
- [MINOR] Add OpenTelemetry support for passkey operations (#2795)
- [MINOR] Add passkey registration support for WebView (#2769)
- [MINOR] Add callback for OneAuth for measuring Broker Discovery Client Perf (#2796)
Expand Down Expand Up @@ -1193,4 +1194,4 @@ Version 0.0.3
* Separate methods for PII/OII logging
- Initial Exception model implemented
* BaseException + Client & Service subclasses
- Substantial portions of HTTP/S networking code migrated from ADAL & MSAL to this module
- Substantial portions of HTTP/S networking code migrated from ADAL & MSAL to this module
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@


import com.microsoft.identity.common.java.authscheme.AbstractAuthenticationScheme;
import com.microsoft.identity.common.java.flighting.CommonFlight;
import com.microsoft.identity.common.java.flighting.CommonFlightsManager;
import com.microsoft.identity.common.java.interfaces.INameValueStorage;
import com.microsoft.identity.common.java.interfaces.IPlatformComponents;
import com.microsoft.identity.common.java.opentelemetry.AttributeName;
import com.microsoft.identity.common.java.opentelemetry.SpanExtension;
import com.microsoft.identity.common.java.providers.oauth2.OAuth2Strategy;
import com.microsoft.identity.common.java.providers.oauth2.OAuth2TokenCache;
import com.microsoft.identity.common.java.WarningType;
Expand Down Expand Up @@ -343,7 +347,7 @@ public synchronized List<ICacheRecord> saveAndLoadAggregatedAccountData(
}

@SuppressWarnings("unchecked")
private List<ICacheRecord> loadAggregatedAccountData(final @NonNull AbstractAuthenticationScheme authScheme,
public List<ICacheRecord> loadAggregatedAccountData(final @NonNull AbstractAuthenticationScheme authScheme,
final @NonNull ICacheRecord cacheRecord) {
final String methodName = ":loadAggregatedAccountData";

Expand Down Expand Up @@ -1638,11 +1642,23 @@ private static <T extends MsalOAuth2TokenCache> T getTokenCache(@NonNull final I
@NonNull final INameValueStorage<String> spfm,
boolean isFoci) {
final ICacheKeyValueDelegate cacheKeyValueDelegate = new CacheKeyValueDelegate();
final IAccountCredentialCache accountCredentialCache =
new SharedPreferencesAccountCredentialCache(
cacheKeyValueDelegate,
spfm
);
final boolean isFlightEnabled = CommonFlightsManager.INSTANCE
.getFlightsProvider()
.isFlightEnabled(CommonFlight.USE_IN_MEMORY_CACHE_FOR_ACCOUNTS_AND_CREDENTIALS);
final IAccountCredentialCache accountCredentialCache;
if (isFlightEnabled) {
accountCredentialCache = new SharedPreferencesAccountCredentialCacheWithMemoryCache(
cacheKeyValueDelegate,
spfm
);
SpanExtension.current().setAttribute(AttributeName.in_memory_cache_used_for_accounts_and_credentials.name(), true);
} else {
accountCredentialCache = new SharedPreferencesAccountCredentialCache(
cacheKeyValueDelegate,
spfm
);
SpanExtension.current().setAttribute(AttributeName.in_memory_cache_used_for_accounts_and_credentials.name(), false);
}
final MicrosoftStsAccountCredentialAdapter accountCredentialAdapter =
new MicrosoftStsAccountCredentialAdapter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ public enum CommonFlight implements IFlightConfig {
* Flight to enable OpenID issuer validation code which validates issuer against the open id well known
* config endpoint and only reports the failure result.
*/
ENABLE_OPENID_ISSUER_VALIDATION_REPORTING("EnableOpenIdIssuerValidationReporting", true);
ENABLE_OPENID_ISSUER_VALIDATION_REPORTING("EnableOpenIdIssuerValidationReporting", true),

/**
* Flight to control whether or not to use in memory cache for accounts and credentials.
*/
USE_IN_MEMORY_CACHE_FOR_ACCOUNTS_AND_CREDENTIALS("UseInMemoryCacheForAccountsAndCredentials", false);

private String key;
private Object defaultValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,17 @@ public enum AttributeName {
is_in_web_cp_flow,

/**
* Indicates whether or not in memory cache is used for accounts and credentials.
*/
in_memory_cache_used_for_accounts_and_credentials,

/**
* Passkey operation type (e.g., registration, authentication).
*/
passkey_operation_type,

/**
* Passkey DOM exception name (if any).
*/
passkey_dom_exception_name,
passkey_dom_exception_name
}
Loading