Skip to content

Connect-MgGraph on 2.41 crashes when making a connection with cert, fixes when using 2.39 or lower #3816

Description

Describe the bug

When using the following code with version 2.39 (or lower) of Graph.authentication, it will work.
Connect-MgGraph -ClientId $ClientID
-TenantId $TenantID -Certificate $cert
-NoWelcome

fresh device with 2.4.1 will crash with this error. work around is to install 2.39 or lower and use this graph.authentication.

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

Expected behavior

I expect it to connect and work.

How to reproduce

Create a certificate and load it. This is used by an api registration with only https://graph.microsoft.com/DeviceManagementServiceConfig.ReadWrite.All

Connect-MgGraph -ClientId $ClientID
-TenantId $TenantID -Certificate $cert
-NoWelcome

upon using this connection command it will crash

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

downgrade and load Graph.authentication 2.39 or lower

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions