Skip to content

Commit 8cf2f3c

Browse files
rpdomeCopilot
andcommitted
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a6d2373 commit 8cf2f3c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public void onReceive(final Context context, final Intent intent) {
6969

7070
Log.w(TAG, "Scopes: " + scopeString);
7171

72-
// Use goAsync() to extend the receiver's lifecycle beyond the 10s limit
72+
// Use goAsync() so work can continue after onReceive() returns.
73+
// The broadcast still has a finite system time budget, so
74+
// PendingResult.finish() must be called promptly.
7375
final PendingResult pendingResult = goAsync();
7476

7577
// Create PCA with default config (uses broker)
@@ -143,6 +145,10 @@ public void onError(MsalException exception) {
143145
pendingResult.finish();
144146
}
145147
});
148+
} else {
149+
Log.e(TAG, "Unexpected app type: " + app.getClass().getName()
150+
+ " — neither single nor multiple account mode.");
151+
pendingResult.finish();
146152
}
147153
}
148154

@@ -158,7 +164,7 @@ private void doSilentAuth(
158164
final AcquireTokenSilentParameters parameters = new AcquireTokenSilentParameters.Builder()
159165
.forAccount(account)
160166
.fromAuthority(account.getAuthority())
161-
.withScopes(Arrays.asList(scopeString.toLowerCase().split(" ")))
167+
.withScopes(Arrays.asList(scopeString.trim().split("\\s+")))
162168
.forceRefresh(true) // Force network call to eSTS (no cache)
163169
.withCallback(new AuthenticationCallback() {
164170
@Override

0 commit comments

Comments
 (0)