Defines the signature of a callback which will be passed to DeviceCodeCredential for the purpose of displaying authentication details to the user.
The type of an Azure Identity plugin, a function accepting a plugin context.
The Error.name value of an AggregateAuthenticationError
The Error.name value of an AuthenticationError
The Error.name value of an CredentialUnavailable
The default authority host.
Generates a CredentialLogger, which is a logger declared at the credential's constructor, and used at any point in the credential. It has all the properties of a CredentialLoggerInstance, plus other logger instances, one per method.
It logs with the format:
[title] => [message]
[title] => getToken() => [message]
Generates a CredentialLoggerInstance.
It logs with the format:
[title] => [message]
Method that logs the user code from the DeviceCodeCredential.
The device code.
Deserializes a previously serialized authentication record from a string into an object.
The input string must contain the following properties:
If the version we receive is unsupported, an error will be thrown.
At the moment, the only available version is: "1.0", which is always set when the authentication record is serialized.
Authentication record previously serialized into string.
AuthenticationRecord.
Formatting the success event on the credentials
Formatting the success event on the credentials
Returns a new instance of the DefaultAzureCredential.
Attempts to load a specific property from the VSCode configurations of the current OS. If it fails at any point, returns undefined.
Based on a given list of environment variable names, logs the environment variables currently assigned during the usage of a credential that goes by the given name.
Name of the credential in use
List of environment variables supported by that credential
Most MSIs send requests to the IMDS endpoint, or a similar endpoint. These are GET requests that require sending a resource
parameter on the query.
This resource can be derived from the scopes received through the getToken call, as long as only one scope is received.
Multiple scopes assume that the resulting token will have access to multiple resources, which won't be the case.
For that reason, when we encounter multiple scopes, we return undefined. It's up to the individual MSI implementations to throw the errors (which helps us provide less generic errors).
Separates a list of environment variable names into a plain object with two arrays: an array of missing environment variables and another array with assigned environment variables.
List of environment variable names
Serializes an AuthenticationRecord
into a string.
The output of a serialized authentication record will contain the following properties:
To later convert this string to a serialized AuthenticationRecord
, please use the exported function deserializeAuthenticationRecord()
.
Extend Azure Identity with additional functionality. Pass a plugin from a plugin package, such as:
@azure/identity-cache-persistence
: provides persistent token caching@azure/identity-vscode
: provides the dependencies of
VisualStudioCodeCredential
and enables itExample:
import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
import { useIdentityPlugin, DefaultAzureCredential } from "@azure/identity";
useIdentityPlugin(cachePersistencePlugin);
// The plugin has the capability to extend `DefaultAzureCredential` and to
// add middleware to the underlying credentials, such as persistence.
const credential = new DefaultAzureCredential({
tokenCachePersistenceOptions: {
enabled: true
}
});
the plugin to register
Generated using TypeDoc
(Browser-only feature) The "login style" to use in the authentication flow: