Share via


ICredentialsLoader Interface

Definition

Contract for credential loaders, implemented by classes like the DefaultCertificateLoader or the DefaultCredentialLoader in Microsoft.Identity.Web. Credential loaders are used to load credentials from a CredentialDescription, the result is then in the CachedValue property. Credential loaders constitute an extensibility point. They delegate to credential source loaders, which are specified in the CredentialSourceLoaders collection, choosing the one which CredentialSource matches the credential source of the credential description to load.

public interface ICredentialsLoader
type ICredentialsLoader = interface
Public Interface ICredentialsLoader
Derived

Properties

CredentialSourceLoaders

Dictionary of credential source loaders per credential source. Your application can add more to process additional credential sources.

Methods

LoadCredentialsIfNeededAsync(CredentialDescription, CredentialSourceLoaderParameters)

Load a given credential description, if needed. This method will leverage the CredentialSourceLoaders to load the credentials from the description.

LoadFirstValidCredentialsAsync(IEnumerable<CredentialDescription>, CredentialSourceLoaderParameters)

Load the first valid credential from the credentials description list. This is useful when you have multiple deployments (for instance on your developer machine, you can use a certificate from KeyVault, and when deployed in AKS, you use workload identity federation for AKS. You can express the list of credentials in the appsettings.json file, and this method will load the most appropriate based on the order.

ResetCredentials(IEnumerable<CredentialDescription>)

Resets resettable credentials in the credential description list (for instance reset the certificates so that they can be re-loaded again) Use, for example, before a retry.

Applies to