Troubleshoot multi-tenant authentication

This article provides guidance on dealing with issues encountered in a multi-tenant context.

When you use credentials in a multi-tenant context, you can optionally try/catch for ClientAuthenticationException. The following table shows the errors that this exception indicates, and methods of mitigation:

Error message Description Mitigation
The current credential is not configured to acquire tokens for tenant <tenant-ID> The application must configure the credential to allow acquiring tokens from the requested tenant. Add the requested tenant ID to additionallyAllowedTenants on the credential builder, or add "*" to additionallyAllowedTenants to allow acquiring tokens for any tenant.

This exception was added as part of a breaking change to multi-tenant authentication in version 1.6.0. Users experiencing this error after upgrading can find information about the change and migration in BREAKING_CHANGES.md

Next steps

If the troubleshooting guidance in this article doesn't help to resolve issues when you use the Azure SDK for Java client libraries, we recommended that you file an issue in the Azure SDK for Java GitHub repository.