File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Authentication.Core/Utilities
Authentication.Test/Helpers Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,11 @@ private static async Task<DeviceCodeCredential> GetDeviceCodeCredentialAsync(IAu
167167 GraphSession . Instance . OutputWriter . WriteObject ( code . Message ) ;
168168 return Task . CompletedTask ;
169169 }
170- catch
170+ catch ( InvalidOperationException )
171+ {
172+ // Fall through to console output if OutputWriter is unavailable.
173+ }
174+ catch ( ObjectDisposedException )
171175 {
172176 // Fall through to console output if OutputWriter is unavailable.
173177 }
Original file line number Diff line number Diff line change @@ -533,7 +533,8 @@ public async Task ShouldUseWamWhenNullWithCustomClientIdAsync()
533533 // reset static instance.
534534 GraphSession . Reset ( ) ;
535535 }
536-
536+
537+
537538 [ Fact ]
538539 public async Task SignInAsync_ShouldCallGetTokenAsync_WithCaeEnabledAsync ( )
539540 {
@@ -617,10 +618,12 @@ await AuthenticationHelpers.SignInAsync(
617618 _ = await authProvider . GetAuthorizationTokenAsync (
618619 new Uri ( "https://graph.microsoft.com/v1.0/me" ) ) ;
619620
620- // Assert: both paths must use isCaeEnabled: true so that MSAL serves
621621 // the cached token silently during API calls.
622+ Assert . NotNull ( signInContext ) ;
622623 Assert . True ( signInContext . IsCaeEnabled ,
623624 "SignInAsync must pass isCaeEnabled: true to GetTokenAsync." ) ;
625+ Assert . NotNull ( providerContext ) ;
626+ "SignInAsync must pass isCaeEnabled: true to GetTokenAsync." ) ;
624627 Assert. True ( providerContext . IsCaeEnabled ,
625628 "AzureIdentityAccessTokenProvider must forward isCaeEnabled: true." ) ;
626629
You can’t perform that action at this time.
0 commit comments