BrokerCredentialResolver Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before itβs released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A CredentialResolver that produces broker-backed
TokenCredential instances from an
IConfigurationSection. It claims sections whose
CredentialSource resolves to BrokerCredential or
VisualStudioCodeCredential β the two credential sources that
require the Azure.Identity.Broker package to function. All
other sources are deferred (return false) so the
next resolver in the chain (typically AzureCredentialResolver)
can claim them.
public sealed class BrokerCredentialResolver : System.ClientModel.Primitives.CredentialResolver
type BrokerCredentialResolver = class
inherit CredentialResolver
Public NotInheritable Class BrokerCredentialResolver
Inherits CredentialResolver
- Inheritance
Remarks
Register this resolver explicitly via AddBrokerCredentialResolver(IServiceCollection) (or its host-builder overload) for the DI flow, or pass an instance to GetAzureClientSettings<T>(IConfiguration, String, CredentialResolver[]) (and friends) for the standalone configuration flow. The class has a public parameterless constructor so it can be used with AddCredentialResolver<BrokerCredentialResolver>().
Constructors
| Name | Description |
|---|---|
| BrokerCredentialResolver() |
Initializes a new instance of BrokerCredentialResolver. |
Properties
| Name | Description |
|---|---|
| Default |
A shared singleton instance suitable for both standalone and DI usage.
SCM's credential cache keys cached providers by resolver reference, so
passing this instance into a standalone |
Methods
| Name | Description |
|---|---|
| TryResolve(IConfigurationSection, AuthenticationTokenProvider) |
Attempts to construct an AuthenticationTokenProvider for the supplied credential configuration section. |
| TryResolve(IConfigurationSection, Func<IConfigurationSection,AuthenticationTokenProvider>, AuthenticationTokenProvider) |
Attempts to construct an AuthenticationTokenProvider for the supplied credential configuration section, with access to a callback that recursively resolves child sections through the same active resolver chain. (Inherited from CredentialResolver) |