Azure / Azure/azure-powershell

Clear-AzContext Cannot Clear TokenCache of OIDC Auth Flow

Open
#23,852 3 comments 1 reaction 1 assignee Claimed by @msJinLei View on GitHub
Accounts bug Tracking
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

When you run Clear-AzContext, the token from user Auth flow can be cleared and the token from OIDC Auth flow cannot be cleared.

### Issue script & Debug output

```PowerShell
PS> Connect-AzAccount -ServicePrincipal -ApplicationId $appId $FederatedToken $token $TenantId $tenantId
PS> Clear-AzContext

The token cache is still there
```

### Environment data

```PowerShell
The issue can be reproduce across the different platforms
```

### Module versions

```PowerShell
The issue can be reproduce across the different Az.Accounts versions
```

### Error output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.