Skip to content

Allow for extension / customization of AzureIdentityAccessTokenProvider::GetTokenAsync #543

@MattKotsenas

Description

@MattKotsenas

The problem

I have a multi-tenant app, and as a result need to generate per-tenant tokens. However, I'm not able to set the tenantId parameter in the GetTokenAsync call here:

var result = await _credential.GetTokenAsync(new TokenRequestContext(scopes, claims: decodedClaim, isCaeEnabled: _isCaeEnabled), cancellationToken).ConfigureAwait(false);

As a result, I need to duplicate the entire implementation of AzureIdentityAccessTokenProvider to set that one value.

The request

My request is to update / refactor AzureIdentityAccessTokenProvider to allow for inheritance / extension of this type of scenario (there are other parameters that others might also want to set such as isProofOfPossessionEnabled and proofOfPossessionNonce) by moving the actual GetTokenAsync call into a virtual method.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waits for author 🔁

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions