Closed jazuntee closed 1 year ago
Thanks for following up on this.
I'm not able to reproduce the issue using the v2.0.0 Preview 4
:
Could you please share more info on:
# Provide output of Get-Module here.
2. Your version table:
``` powershell
# Provide output of $PSVersionTable here.
# Provide output of [System.AppDomain]::CurrentDomain.GetAssemblies() here.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
I'm having the same issue as described above. Getting prompted to re-authorize after iterating through each user.
Thanks for following up on this.
I'm not able to reproduce the issue using the
v2.0.0 Preview 4
:Could you please share more info on:
- Loaded modules before and after auth re-prompt:
# Provide output of Get-Module here.
- Your version table:
# Provide output of $PSVersionTable here.
- Loaded assemblies before and after auth re-prompt:
# Provide output of [System.AppDomain]::CurrentDomain.GetAssemblies() here.
@HappyEarthDay, could you please share the above details? We can't repro this behavior on our end using v2.x preview.
This issue is annoyingly sporadic but the following seems to trigger it most of the time, using a different scope each time. I also found that authenticating with a different user in the first connect vs the second connect seems to cause the issue more consistently.
Connect-MgGraph -TenantId jasoth.onmicrosoft.com
Connect-MgGraph -TenantId jasoth.net -Scopes WindowsUpdates.ReadWrite.All
Get-MgServicePrincipal
Loaded modules before and after auth re-prompt:
PS C:\Users\jasoth> Get-Module
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.0.0 preview5 Microsoft.Graph.Authentication {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext…}
Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest 7.0.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Script 2.2.6 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}
PS C:\Users\jasoth> Get-MgServicePrincipal
Get-MgServicePrincipal_List: InteractiveBrowserCredential authentication failed: User canceled authentication.
PS C:\Users\jasoth> Get-Module
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.0.0 preview5 Microsoft.Graph.Applications {Add-MgApplicationKey, Add-MgApplicationPassword, Add-MgServicePrincipalKey, Add-MgServicePrincipalPassword…}
Script 2.0.0 preview5 Microsoft.Graph.Authentication {Add-MgEnvironment, Connect-MgGraph, Disconnect-MgGraph, Get-MgContext…}
Manifest 7.0.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest 7.0.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Script 2.2.6 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}
Your version table:
PS C:\Users\jasoth> $PSVersionTable
Name Value
---- -----
PSVersion 7.3.2
PSEdition Core
GitCommitId 7.3.2
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Loaded assemblies before and after auth re-prompt:
PS C:\Users\jasoth> [System.AppDomain]::CurrentDomain.GetAssemblies()
GAC Version Location
--- ------- --------
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.CoreLib.dll
False v4.0.30319 C:\Program Files\PowerShell\7\pwsh.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.ConsoleHost.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Management.Automation.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Thread.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.InteropServices.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.Process.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.RegularExpressions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Xml.ReaderWriter.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.Concurrent.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.Xml.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Encoding.Extensions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Numerics.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Memory.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Win32.Registry.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Management.Infrastructure.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Linq.Expressions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.Specialized.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Newtonsoft.Json.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.DirectoryServices.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ComponentModel.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ComponentModel.TypeConverter.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.Uri.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ObjectModel.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.NetworkInformation.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Mail.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Management.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.AccessControl.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Serialization.Formatters.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.TraceSource.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Linq.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Serialization.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Data.Common.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ComponentModel.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Emit.Lightweight.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Emit.ILGeneration.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.CoreCLR.Eventing.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Win32.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Console.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Principal.Windows.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Claims.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.ApplicationInsights.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.DiagnosticSource.dll
False v4.0.30319 C:\Program Files\PowerShell\7\netstandard.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.MemoryMappedFiles.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.Tracing.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.Xml.Linq.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.Pipes.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Xml.XDocument.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Tasks.Parallel.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.FileSystem.AccessControl.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.FileSystem.DriveInfo.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Encoding.CodePages.dll
False v4.0.30319 C:\Program Files\PowerShell\7\getfilesiginforedistwrapper.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Permissions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.StackTrace.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Overlapped.dll
False
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Loader.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.ThreadPool.dll
False v4.0.30319 C:\program files\powershell\7\Modules\PSReadLine\Microsoft.PowerShell.PSReadLine2.dll
False v4.0.30319 C:\Program Files\PowerShell\7\mscorlib.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Management.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Utility.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.MarkdownRender.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Http.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Core.dll
False v4.0.30319 C:\program files\powershell\7\Modules\PSReadLine\net6plus\Microsoft.PowerShell.PSReadLine.Polyfiller.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.InteropServices.RuntimeInformation.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.NonGeneric.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Microsoft.Graph.Authentication.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Microsoft.Graph.Authentication.Core.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Diagnostics.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Security.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.WSMan.Management.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.WSMan.Runtime.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Azure.Core.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Azure.Identity.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Bcl.AsyncInterfaces.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.Identity.Client.Extensions.Msal.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.Abstractions.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.JsonWebTokens.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.Logging.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.Tokens.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Buffers.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\System.IdentityModel.Tokens.Jwt.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Numerics.Vectors.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.CompilerServices.Unsafe.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Encodings.Web.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Json.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Tasks.Extensions.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Core\Microsoft.Identity.Client.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Security.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Extensions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.FileSystem.Watcher.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.ProtectedData.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Tasks.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Principal.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Core\Microsoft.Graph.Core.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.Compression.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Quic.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Sockets.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.NameResolution.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.Algorithms.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Metadata.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.Immutable.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.HttpListener.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.WebHeaderCollection.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Requests.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.Debug.dll
PS C:\Users\jasoth> Get-MgServicePrincipal
Get-MgServicePrincipal_List: InteractiveBrowserCredential authentication failed: User canceled authentication.
PS C:\Users\jasoth> [System.AppDomain]::CurrentDomain.GetAssemblies()
GAC Version Location
--- ------- --------
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.CoreLib.dll
False v4.0.30319 C:\Program Files\PowerShell\7\pwsh.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.ConsoleHost.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Management.Automation.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Thread.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.InteropServices.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.Process.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.RegularExpressions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Xml.ReaderWriter.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.Concurrent.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.Xml.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Encoding.Extensions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Numerics.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Memory.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Win32.Registry.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Management.Infrastructure.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Linq.Expressions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.Specialized.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Newtonsoft.Json.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.DirectoryServices.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ComponentModel.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ComponentModel.TypeConverter.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.Uri.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ObjectModel.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.NetworkInformation.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Mail.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Management.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.AccessControl.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Serialization.Formatters.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.TraceSource.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Linq.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Serialization.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Data.Common.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.ComponentModel.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Emit.Lightweight.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Emit.ILGeneration.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.CoreCLR.Eventing.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Win32.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Console.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Principal.Windows.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Claims.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.ApplicationInsights.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.DiagnosticSource.dll
False v4.0.30319 C:\Program Files\PowerShell\7\netstandard.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.MemoryMappedFiles.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.Tracing.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Private.Xml.Linq.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.Pipes.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Xml.XDocument.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Tasks.Parallel.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.FileSystem.AccessControl.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.FileSystem.DriveInfo.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Encoding.CodePages.dll
False v4.0.30319 C:\Program Files\PowerShell\7\getfilesiginforedistwrapper.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Permissions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.StackTrace.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Overlapped.dll
False
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Loader.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.ThreadPool.dll
False v4.0.30319 C:\program files\powershell\7\Modules\PSReadLine\Microsoft.PowerShell.PSReadLine2.dll
False v4.0.30319 C:\Program Files\PowerShell\7\mscorlib.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Management.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Utility.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.MarkdownRender.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Http.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Core.dll
False v4.0.30319 C:\program files\powershell\7\Modules\PSReadLine\net6plus\Microsoft.PowerShell.PSReadLine.Polyfiller.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.InteropServices.RuntimeInformation.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.NonGeneric.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Microsoft.Graph.Authentication.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Microsoft.Graph.Authentication.Core.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Diagnostics.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.PowerShell.Security.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.WSMan.Management.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.WSMan.Runtime.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Azure.Core.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Azure.Identity.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.Bcl.AsyncInterfaces.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.Identity.Client.Extensions.Msal.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.Abstractions.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.JsonWebTokens.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.Logging.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Microsoft.IdentityModel.Tokens.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Buffers.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\System.IdentityModel.Tokens.Jwt.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Numerics.Vectors.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.CompilerServices.Unsafe.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Encodings.Web.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Text.Json.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Tasks.Extensions.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Core\Microsoft.Identity.Client.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Security.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Runtime.Extensions.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.FileSystem.Watcher.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.ProtectedData.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Threading.Tasks.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Principal.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Authentication\2.0.0\Dependencies\Core\Microsoft.Graph.Core.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.IO.Compression.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Quic.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Sockets.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.NameResolution.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.Algorithms.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Security.Cryptography.Primitives.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Reflection.Metadata.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Collections.Immutable.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.HttpListener.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.WebHeaderCollection.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.Requests.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Diagnostics.Debug.dll
False v4.0.30319 C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph.Applications\2.0.0\bin\Microsoft.Graph.Applications.private.dll
False v4.0.30319 C:\Program Files\PowerShell\7\System.Net.WebProxy.dll
False v4.0.30319 C:\Program Files\PowerShell\7\Microsoft.CSharp.dll
@peombwa Can this issue be reopened?
@jasoth, I've reopened the issue for us to investigate.
Closing as not reproducible in multiple environments even after the GA of v2. No other customer has also reported this behavior.
Feel free to open a new issue should the bug reappear.
It would appear issue #359 "Connect-Graph - Running any command after connected will reprompt for authentication" did not fix the issue entirely. This has continued to happen to me for months and I never really took the time to reproduce it consistently until now.
1) Run Connect-MgGraph and complete authentication if necessary. 2) Run "Connect-MgGraph -TenantId -Scope " and consent to any new scope. The scope must be one that has not been consented to yet (but can be completely unrelated to the next command) and the issue only appears to happen when -TenantId is also specified.
3) Run almost any command like Get-MgServicePrincipal and it will reprompt for authentication and consent for all previously consented scopes. However, Get-MgUser does not exhibit this behavior.
For debugging purposes, the authentication prompt happens right after the following debug output. "DEBUG: [Authentication]: - Scopes: [Application.Read.All, Application.ReadWrite.All, CrossTenantInformation.ReadBasic.All, email, openid, profile, User.Read, User.Read.All, User.ReadBasic.All, User.ReadWrite.All, ExternalConnection.Read.All]."