Skip to content

Connect-MgGraph failing on 2.0.0-preview6 when connecting with client secret #1880

@ajbeaven

Description

@ajbeaven

I'm not sure if it's related specifically to authenticating with a client secret (I doubt it), however I'm running the following code which has been failing since version 2.0.0-preview6 was released today:

Install-Module Microsoft.Graph -AllowPrerelease -AllowClobber -Force

$clientSecret = ConvertTo-SecureString -String {CLIENTSECRET} -AsPlainText -Force
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList {CLIENTID}, $clientSecret
Connect-MgGraph -TenantId {TENANTID} -ClientSecretCredential $credential

The error received:

Method 'RefreshCacheAsync' in type 'Microsoft.Graph.PowerShell.Authentication.Core.TokenCache.InMemoryTokenCacheOptions' from assembly 'Microsoft.Graph.Authentication.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

When I explicitly install 2.0.0-preview5, the script starts working again.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions