File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/Authentication/Authentication.Core/Utilities Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 22// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
33// ------------------------------------------------------------------------------
44using Azure . Core ;
5+ using Azure . Core . Diagnostics ;
56using Azure . Identity ;
67using Microsoft . Graph . PowerShell . Authentication . Core . Extensions ;
78using Microsoft . Identity . Client ;
89using Microsoft . Identity . Client . Extensions . Msal ;
910using System ;
11+ using System . Diagnostics . Tracing ;
1012using System . Globalization ;
1113using System . IO ;
1214using System . Linq ;
@@ -201,8 +203,14 @@ public static async Task<IAuthContext> AuthenticateAsync(IAuthContext authContex
201203 {
202204 try
203205 {
204- signInAuthContext = await SignInAsync ( authContext , cancellationToken ) . ConfigureAwait ( false ) ;
205- retrySignIn = false ;
206+ // Write MSAL logs to debug stream.
207+ using ( AzureEventSourceListener listener = new AzureEventSourceListener (
208+ ( args , message ) => GraphSession . Instance . OutputWriter . WriteDebug ( $ "{ message } ") ,
209+ level : EventLevel . Informational ) )
210+ {
211+ signInAuthContext = await SignInAsync ( authContext , cancellationToken ) . ConfigureAwait ( false ) ;
212+ retrySignIn = false ;
213+ } ;
206214 }
207215 catch ( AuthenticationFailedException authEx )
208216 {
You can’t perform that action at this time.
0 commit comments