Skip to content

Connect-Graph - Running any command after connected will reprompt for authentication #359

@o-l-a-v

Description

@o-l-a-v

In PowerShell 5.1 (not using ISE, because of #247, #289), straight after running Connect-Graph and trying to run any command, Microsoft.Graph asks for reauthentication.

Code to reproduce

PS C:\Users\OlavRønnestadBirkela> Microsoft.Graph.Authentication\Connect-Graph -TenantId '<some_verified_domain>' -Scopes (
>>     'User.Read.All',
>>     'Group.Read.All',
>>     'Policy.Read.All'
>> )
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <removed> to authenticate.
Welcome To Microsoft Graph!
PS C:\Users\OlavRønnestadBirkela> Microsoft.Graph.Identity.ConditionalAccess\Get-MgIdentityConditionalAccessNamedLocation
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <removed> to authenticate.

Id                                   CreatedDateTime DisplayName ModifiedDateTime
--                                   --------------- ----------- ----------------
<removed results>


PS C:\Users\OlavRønnestadBirkela>

$PSVersionTable

PS C:\Users\OlavRønnestadBirkela> $PSVersionTable | Format-Table -Force

Name                           Value
----                           -----
PSVersion                      5.1.19041.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Get-Module -Name 'Microsoft.Graph.*'

PS C:\Users\OlavRønnestadBirkela> Get-Module -Name 'Microsoft.Graph.*' | Select-Object -Property 'Name','Version'

Name                                       Version
----                                       -------
Microsoft.Graph.Authentication             0.9.1
Microsoft.Graph.Identity.ConditionalAccess 0.9.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions