[Identity] Client assertion add token cache persistence (#31129)

To have ClientAssertionCredentialOptions implement
ISupportsTokenCachePersistenceOptions. As a consumer of Identity, Azure
PowerShell is dependent on the Azure Identity library for .NET. Now the
client assertion workflow has increasing usage, so the ask should have
higher priority.

Business Impact:
In the client assertion auth flow, Azure PowerShell customers acquire
the access token with the federated token. The access token must be used
by the subsequent Azure PowerShell cmdlets. We depend on Azure.Identity
to save the tokens to the MSAL cache. As the federated token has a short
lifetime, it's impossible to cache the federated token and
reauthenticate every time a cmdlet is run.
This commit is contained in:
KarishmaGhiya 2024-09-16 15:29:06 -07:00 коммит произвёл GitHub
Родитель 5b025d1eaa
Коммит e58bc20587
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -6,6 +6,7 @@
- Added support for the field `refreshAfterTimestamp` in `AccessToken` [#30402](https://github.com/Azure/azure-sdk-for-js/pull/30402)
- Added support for providing an object ID to `ManagedIdentityCredential`. [#30771](https://github.com/Azure/azure-sdk-for-js/pull/30771)
- Added support for token cache persistence via the `CredentialTokenPersistence` options to the `ClientAssertionCredential`. [#31129](https://github.com/Azure/azure-sdk-for-js/pull/31129)
### Breaking Changes

Просмотреть файл

@ -177,7 +177,7 @@ export class ClientAssertionCredential implements TokenCredential {
}
// @public
export interface ClientAssertionCredentialOptions extends MultiTenantTokenCredentialOptions, AuthorityValidationOptions {
export interface ClientAssertionCredentialOptions extends MultiTenantTokenCredentialOptions, CredentialPersistenceOptions, AuthorityValidationOptions {
}
// @public

Просмотреть файл

@ -2,6 +2,7 @@
// Licensed under the MIT License.
import { AuthorityValidationOptions } from "./authorityValidationOptions";
import { CredentialPersistenceOptions } from "./credentialPersistenceOptions";
import { MultiTenantTokenCredentialOptions } from "./multiTenantTokenCredentialOptions";
/**
@ -9,4 +10,5 @@ import { MultiTenantTokenCredentialOptions } from "./multiTenantTokenCredentialO
*/
export interface ClientAssertionCredentialOptions
extends MultiTenantTokenCredentialOptions,
CredentialPersistenceOptions,
AuthorityValidationOptions {}