WARNING: Unable to acquire token for tenant 'organizations' with error 'InteractiveBrowserCredential authentication failed: Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Identity.Client.ITokenCa

EnterpriseArchitect 5,406 Reputation points
2023-08-08T13:25:14.0933333+00:00

Hi Team,

Can someone here please assist me with this error to connect my PowerShell session using the Connect-AzAccount ?

PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Connect-AzAccount
WARNING: Unable to acquire token for tenant 'organizations' with error 'InteractiveBrowserCredential authentication failed: Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Micros
oft.Identity.Client.ITokenCache)'.'
WARNING: Please run 'Connect-AzAccount -DeviceCode' if browser is not supported in this session.
Connect-AzAccount : InteractiveBrowserCredential authentication failed: Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Identity.Client.ITokenCache)'.
At line:1 char:1
+ Connect-AzAccount
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzAccount], AuthenticationFailedException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand
 

PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Connect-AzAccount -UseDeviceAuthentication
WARNING: Unable to acquire token for tenant 'organizations' with error 'DeviceCodeCredential authentication failed: Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Iden
tity.Client.ITokenCache)'.'
Connect-AzAccount : DeviceCodeCredential authentication failed: Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Identity.Client.ITokenCache)'.
At line:1 char:1
+ Connect-AzAccount -UseDeviceAuthentication
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Connect-AzAccount], AuthenticationFailedException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Clear-AzContext  PS C:\WINDOWS\system32\WindowsPowerShell\v1.0> Clear-AzContext -Scope CurrentUser Clear-AzContext : Method not found: 'Void Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Identity.Client.ITokenCache)'. At line:1 char:1 + Clear-AzContext -Scope CurrentUser + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : CloseError: (:) [Clear-AzContext], MissingMethodException     + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.Context.ClearAzureRmContext

Thank you in advance.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,265 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,593 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,095 questions
{count} votes

Accepted answer
  1. Hitesh Ramesh Janjrukiya 255 Reputation points
    2024-05-30T13:31:10.7233333+00:00

    I solved same issue with executing below command in windows PowerShell and ISE PowerShell

    Update-AzConfig -EnableLoginByWam $false

    36 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Brian Zarb 1,655 Reputation points
    2023-08-08T16:16:42.8566667+00:00

    Hi,

    Typically this happens because of some outdated module, simply try by updating them:

    I included the MS id client as The error points towards an issue with the Microsoft.Identity.Client.

    Update-Module -Name Az
    Install-Module -Name Microsoft.Identity.Client
    

    or just fresh re-install:

    Uninstall-Module -Name Az -AllVersions 
    Install-Module -Name Az -AllowClobber -Scope CurrentUser
    

    Also, check if you have the latest Powershell installed and .Net Fw:

    $PSVersionTable.PSVersion
    

    and for .Net go in: (Regedit)

    HKLM:\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP

    I hope that this was useful !

    4 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.