If set to true, allows authentication flows to change the tenantId of the request if a different tenantId is received from a challenge or through a direct getToken call.
Result of a previous authentication that can be used to retrieve the cached credentials of each individual account. This is necessary to provide in case the application wants to work with more than one account per Client ID and Tenant ID pair.
This record can be retrieved by calling to the credential's authenticate()
method, as follows:
const authenticationRecord = await credential.authenticate();
The authority host to use for authentication requests. The default is "https://login.microsoftonline.com".
The client (application) ID of an App Registration in the tenant.
Makes getToken throw if a manual authentication is necessary.
Developers will need to call to authenticate()
to control when to manually authenticate.
loginHint allows a user name to be pre-selected for interactive logins. Setting this option skips the account selection prompt and immediately attempts to login with the specified account.
Gets the redirect URI of the application. This should be same as the value
in the application registration portal. Defaults to window.location.href
.
The Azure Active Directory tenant (directory) ID.
Options to provide to the persistence layer (if one is available) when storing credentials.
You must first register a persistence provider as an extension. See the
@azure/identity-cache-persistence
package on NPM.
Example:
import persistence from "@azure/identity-cache-persistence";
import { useIdentityExtension, DeviceCodeCredential } from "@azure/identity";
useIdentityExtension(persistence);
async function main() {
const credential = new DeviceCodeCredential({
tokenCachePersistenceOptions: {
name: "mycustomcachename"
}
});
}
main().catch((error) => {
console.error("An error occured:", error);
process.exit(1);
});
-
Generated using TypeDoc
Defines the common options for the InteractiveBrowserCredential class.