You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: IDX14102 Error When Using Microsoft Graph PowerShell
3
+
description: Resolves an error that occurs when you run the Microsoft Graph PowerShell cmdlet Connect-MgGraph.
4
+
ms.date: 07/01/2025
5
+
ms.service: entra-id
6
+
ms.custom: sap:Problem with using the Graph SDK - libraries
7
+
ms.reviewer: adoyle, willfid, nualex, v-weizhu
8
+
---
9
+
10
+
# Microsoft Graph PowerShell throws error "IDX14102: Unable to decode the header"
11
+
12
+
This article provides solutions to the error "IDX14102: Unable to decode the header" that occurs when you use Microsoft Graph PowerShell.
13
+
14
+
## Symptoms
15
+
16
+
When running the Microsoft Graph PowerShell command `Connect-MgGraph -AccessToken $token`, you receive the following error:
17
+
18
+
> IDX14102: Unable to decode the header
19
+
20
+
## Cause
21
+
22
+
This error occurs because an invalid access token is passed to the `AccessToken` parameter of the `Connect-MgGraph` cmdlet. This problem often occurs when the token is obtained via Azure PowerShell's `Get-AzAccessToken` cmdlet and passed as a `SecureString`. This behavior is observed starting with version 5.0.0 of the `Az.Accounts` module. Starting from Microsoft Graph PowerShell version 2.28.0, the `Connect-MgGraph` command accepts only a plain string as the `AccessToken` parameter.
23
+
24
+
## Solution
25
+
26
+
Here are two solutions for resolving this issue:
27
+
28
+
- Make sure the access token passed to the `AccessToken` parameter of the `Connect-MgGraph` cmdlet is valid.
29
+
30
+
For more information about access tokens, see [Access tokens in the Microsoft identity platform](/entra/identity-platform/access-tokens).
31
+
32
+
- If you use the `Get-AzAccessToken` cmdlet to obtain the access token, use one of the following methods:
33
+
34
+
- Downgrade `Az.Accounts` to version 4.2.0 to avoid the token being returned as a `SecureString`.
35
+
- Convert the token from `SecureString` to `String`:
0 commit comments