2323package com .microsoft .identity .client .msal .automationapp .testpass .broker .concurrent ;
2424
2525import java .util .ArrayList ;
26- import java .util .Arrays ;
2726import java .util .Collections ;
2827import java .util .List ;
2928import java .util .concurrent .CountDownLatch ;
4140 * call per (thread, iteration) slot; the helper manages thread creation,
4241 * synchronization, error collection, and timeout enforcement.</p>
4342 *
44- * <p>The scope pool ({@link #THREAD_SCOPES }) mirrors the design used in the
43+ * <p>The scope pool ({@link #SCOPE_POOL }) mirrors the design used in the
4544 * msaltestapp's {@code ConcurrentAcquireTokenExecutor}: each thread is
46- * assigned a distinct scope set so that the MSAL {@code CommandDispatcher}
45+ * assigned a distinct scope so that the MSAL {@code CommandDispatcher}
4746 * cannot collapse concurrent in-flight requests that would otherwise be
4847 * identical.</p>
4948 */
@@ -52,37 +51,37 @@ public final class ConcurrentAcquireTokenSilentHelper {
5251 private ConcurrentAcquireTokenSilentHelper () { /* utility class */ }
5352
5453 /**
55- * Scope combinations rotated per-thread to prevent the
56- * {@code CommandDispatcher} from deduplicating concurrent requests that
57- * share identical parameters.
54+ * Scopes rotated per-thread to prevent the {@code CommandDispatcher}
55+ * from deduplicating concurrent requests that share identical parameters.
5856 *
59- * <p>The array contains exactly 13 entries, matching the default value of
60- * the {@code concurrent_count} field in the msaltestapp UI.</p>
57+ * <p>Matches the {@code SCOPE_POOL} used in the msaltestapp's
58+ * {@code ConcurrentAcquireTokenExecutor.kt}, with 13 entries to cover
59+ * the default {@code concurrent_count} value in the msaltestapp UI.</p>
6160 */
62- public static final String [][] THREAD_SCOPES = {
63- { "User .read"} ,
64- { "User.read" , "profile" } ,
65- { "User .read", "openid" } ,
66- { "User .read", "email" } ,
67- { "User .read", "offline_access" } ,
68- { "User .read", "profile" , "openid" } ,
69- { "User .read" , "profile" , "email" } ,
70- { "User .read", "openid" , "email" } ,
71- { "User .read", "openid" , "offline_access" } ,
72- { "User .read", "email" , "offline_access" } ,
73- { "User .read" , "profile" , "openid" , "email" } ,
74- { "User .read" , "profile" , "offline_access" } ,
75- { "User .read" , "openid" , "email" , "offline_access" }
61+ public static final String [] SCOPE_POOL = {
62+ "user .read" ,
63+ "user.readbasic.all" ,
64+ "mail .read" ,
65+ "calendars .read" ,
66+ "contacts .read" ,
67+ "files .read" ,
68+ "files .read.all" ,
69+ "people .read" ,
70+ "notes .read" ,
71+ "tasks .read" ,
72+ "sites .read.all" ,
73+ "directory .read.all" ,
74+ "group .read.all"
7675 };
7776
7877 /**
79- * Returns a mutable {@link List} of scopes assigned to {@code threadIndex},
80- * cycling through {@link #THREAD_SCOPES } when
81- * {@code threadIndex >= THREAD_SCOPES .length}.
78+ * Returns a mutable {@link List} containing the single scope assigned to
79+ * {@code threadIndex}, cycling through {@link #SCOPE_POOL } when
80+ * {@code threadIndex >= SCOPE_POOL .length}.
8281 */
8382 public static List <String > scopesForThread (final int threadIndex ) {
8483 return new ArrayList <>(
85- Arrays . asList ( THREAD_SCOPES [threadIndex % THREAD_SCOPES .length ]));
84+ Collections . singletonList ( SCOPE_POOL [threadIndex % SCOPE_POOL .length ]));
8685 }
8786
8887 // -------------------------------------------------------------------------
0 commit comments