@@ -96,7 +96,6 @@ public async Task ExtractNonceWithAuthParserAndValidateShrAsync()
96
96
{
97
97
var labResponse = await LabUserHelper . GetDefaultUserAsync ( ) . ConfigureAwait ( false ) ;
98
98
string [ ] scopes = { "User.Read" } ;
99
- string [ ] expectedScopes = { "email" , "offline_access" , "openid" , "profile" , "User.Read" } ;
100
99
101
100
//Arrange & Act
102
101
//Test for nonce in WWW-Authenticate header
@@ -123,14 +122,19 @@ public async Task ExtractNonceWithAuthParserAndValidateShrAsync()
123
122
requestUri )
124
123
. ExecuteAsync ( ) . ConfigureAwait ( false ) ;
125
124
126
- MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , expectedScopes , true ) ;
125
+ MsalAssert . AssertAuthResult (
126
+ result ,
127
+ TokenSource . Broker ,
128
+ labResponse . Lab . TenantId ,
129
+ scopes , true ) ;
127
130
128
131
PoPValidator . VerifyPoPToken (
129
132
labResponse . App . AppId ,
130
133
requestUri . AbsoluteUri ,
131
134
HttpMethod . Get ,
132
135
result ) ;
133
136
}
137
+
134
138
135
139
[ IgnoreOnOneBranch ]
136
140
[ TestMethod ]
@@ -197,8 +201,7 @@ public async Task WamSilentAuthLoginHintNoAccontInCacheAsync()
197
201
public async Task WamUsernamePasswordRequestAsync ( )
198
202
{
199
203
var labResponse = await LabUserHelper . GetDefaultUserAsync ( ) . ConfigureAwait ( false ) ;
200
- string [ ] scopes = { "User.Read" } ;
201
- string [ ] expectedScopes = { "email" , "offline_access" , "openid" , "profile" , "User.Read" } ;
204
+ string [ ] scopes = { "User.Read" } ;
202
205
203
206
IntPtr intPtr = GetForegroundWindow ( ) ;
204
207
@@ -214,7 +217,7 @@ public async Task WamUsernamePasswordRequestAsync()
214
217
// Acquire token using username password
215
218
var result = await pca . AcquireTokenByUsernamePassword ( scopes , labResponse . User . Upn , labResponse . User . GetOrFetchPassword ( ) ) . ExecuteAsync ( ) . ConfigureAwait ( false ) ;
216
219
217
- MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , expectedScopes ) ;
220
+ MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , scopes ) ;
218
221
Assert . IsNotNull ( result . AuthenticationResultMetadata . Telemetry ) ;
219
222
220
223
// Get Accounts
@@ -227,7 +230,7 @@ public async Task WamUsernamePasswordRequestAsync()
227
230
// Acquire token silently
228
231
result = await pca . AcquireTokenSilent ( scopes , account ) . ExecuteAsync ( ) . ConfigureAwait ( false ) ;
229
232
230
- MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , expectedScopes ) ;
233
+ MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , scopes ) ;
231
234
Assert . IsNotNull ( result . AuthenticationResultMetadata . Telemetry ) ;
232
235
233
236
// Remove Account
@@ -288,7 +291,6 @@ public async Task WamUsernamePasswordWithForceRefreshAsync()
288
291
{
289
292
var labResponse = await LabUserHelper . GetDefaultUserAsync ( ) . ConfigureAwait ( false ) ;
290
293
string [ ] scopes = { "User.Read" } ;
291
- string [ ] expectedScopes = { "email" , "offline_access" , "openid" , "profile" , "User.Read" } ;
292
294
293
295
IntPtr intPtr = GetForegroundWindow ( ) ;
294
296
Func < IntPtr > windowHandleProvider = ( ) => intPtr ;
@@ -310,7 +312,7 @@ public async Task WamUsernamePasswordWithForceRefreshAsync()
310
312
311
313
string ropcToken = result . AccessToken ;
312
314
313
- MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , expectedScopes ) ;
315
+ MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , scopes ) ;
314
316
Assert . IsNotNull ( result . AuthenticationResultMetadata . Telemetry ) ;
315
317
316
318
// Get Accounts
@@ -339,7 +341,6 @@ public async Task WamUsernamePasswordRequestAsync_WithPiiAsync()
339
341
{
340
342
var labResponse = await LabUserHelper . GetDefaultUserAsync ( ) . ConfigureAwait ( false ) ;
341
343
string [ ] scopes = { "User.Read" } ;
342
- string [ ] expectedScopes = { "email" , "offline_access" , "openid" , "profile" , "User.Read" } ;
343
344
344
345
IntPtr intPtr = GetForegroundWindow ( ) ;
345
346
@@ -358,7 +359,7 @@ public async Task WamUsernamePasswordRequestAsync_WithPiiAsync()
358
359
// Acquire token using username password
359
360
var result = await pca . AcquireTokenByUsernamePassword ( scopes , labResponse . User . Upn , labResponse . User . GetOrFetchPassword ( ) ) . ExecuteAsync ( ) . ConfigureAwait ( false ) ;
360
361
361
- MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , expectedScopes ) ;
362
+ MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , scopes ) ;
362
363
Assert . IsNotNull ( result . AuthenticationResultMetadata . Telemetry ) ;
363
364
364
365
// Get Accounts
@@ -374,7 +375,7 @@ public async Task WamUsernamePasswordRequestAsync_WithPiiAsync()
374
375
// Acquire token silently
375
376
result = await pca . AcquireTokenSilent ( scopes , account ) . ExecuteAsync ( ) . ConfigureAwait ( false ) ;
376
377
377
- MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , expectedScopes ) ;
378
+ MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , scopes ) ;
378
379
Assert . IsNotNull ( result . AuthenticationResultMetadata . Telemetry ) ;
379
380
380
381
await pca . RemoveAsync ( account ) . ConfigureAwait ( false ) ;
@@ -392,7 +393,6 @@ public async Task WamListWindowsWorkAndSchoolAccountsAsync()
392
393
{
393
394
var labResponse = await LabUserHelper . GetDefaultUserAsync ( ) . ConfigureAwait ( false ) ;
394
395
string [ ] scopes = { "User.Read" } ;
395
- string [ ] expectedScopes = { "email" , "offline_access" , "openid" , "profile" , "User.Read" } ;
396
396
397
397
IntPtr intPtr = GetForegroundWindow ( ) ;
398
398
@@ -411,7 +411,7 @@ public async Task WamListWindowsWorkAndSchoolAccountsAsync()
411
411
// Acquire token using username password
412
412
var result = await pca . AcquireTokenByUsernamePassword ( scopes , labResponse . User . Upn , labResponse . User . GetOrFetchPassword ( ) ) . ExecuteAsync ( ) . ConfigureAwait ( false ) ;
413
413
414
- MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , expectedScopes ) ;
414
+ MsalAssert . AssertAuthResult ( result , TokenSource . Broker , labResponse . Lab . TenantId , scopes ) ;
415
415
Assert . IsNotNull ( result . AuthenticationResultMetadata . Telemetry ) ;
416
416
417
417
// Get Accounts
0 commit comments