AadCredentialBuilderBase<T> Class
- java.
lang. Object - com.
azure. identity. CredentialBuilderBase<T> - com.
azure. identity. AadCredentialBuilderBase<T>
- com.
- com.
Type Parameters
- T
the type of the credential builder
public abstract class AadCredentialBuilderBase
extends CredentialBuilderBase<T>
The base class for credential builders that allow specifying a client ID, tenant ID, authority host, and additionally allowed tenants for Microsoft Entra ID.
Constructor Summary
Constructor | Description |
---|---|
AadCredentialBuilderBase() |
Constructs an instance of Aad |
Method Summary
Modifier and Type | Method and Description |
---|---|
T |
additionallyAllowedTenants(String[] additionallyAllowedTenants)
For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. |
T |
additionallyAllowedTenants(List<String> additionallyAllowedTenants)
For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. |
T |
authorityHost(String authorityHost)
Specifies the Microsoft Entra endpoint to acquire tokens. |
T |
clientId(String clientId)
Sets the client ID of the application. |
T |
disableInstanceDiscovery()
Disables the setting which determines whether or not instance discovery is performed when attempting to authenticate. |
T |
enableUnsafeSupportLogging()
Enables additional support logging for public and confidential client applications. |
T |
executorService(ExecutorService executorService)
Specifies the Executor |
T |
tenantId(String tenantId)
Sets the tenant ID of the application. |
Methods inherited from CredentialBuilderBase
Methods inherited from java.lang.Object
Constructor Details
AadCredentialBuilderBase
public AadCredentialBuilderBase()
Constructs an instance of AadCredentialBuilderBase.
Method Details
additionallyAllowedTenants
public T additionallyAllowedTenants(String[] additionallyAllowedTenants)
For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant on which the application is installed.
Parameters:
Returns:
additionallyAllowedTenants
public T additionallyAllowedTenants(List
For multi-tenant applications, specifies additional tenants for which the credential may acquire tokens. Add the wildcard value "*" to allow the credential to acquire tokens for any tenant on which the application is installed.
Parameters:
Returns:
authorityHost
public T authorityHost(String authorityHost)
Specifies the Microsoft Entra endpoint to acquire tokens.
Parameters:
Returns:
clientId
public T clientId(String clientId)
Sets the client ID of the application.
Parameters:
Returns:
disableInstanceDiscovery
public T disableInstanceDiscovery()
Disables the setting which determines whether or not instance discovery is performed when attempting to authenticate. This will completely disable both instance discovery and authority validation. This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack. The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority. By utilizing this API, the validation of the authority is disabled. As a result, it is crucial to ensure that the configured authority host is valid and trustworthy.
Returns:
enableUnsafeSupportLogging
public T enableUnsafeSupportLogging()
Enables additional support logging for public and confidential client applications. This enables PII logging in MSAL4J as described here.
This operation will log PII including tokens. It should only be used when directed by support.
Returns:
executorService
public T executorService(ExecutorService executorService)
Specifies the ExecutorService to be used to execute the authentication requests. Developer is responsible for maintaining the lifecycle of the ExecutorService.
If this is not configured, the common fork join pool will be used which is also shared with other application tasks. If the common pool is heavily used for other tasks, authentication requests might starve and setting up this executor service should be considered.
The executor service and can be safely shutdown if the TokenCredential is no longer being used by the Azure SDK clients and should be shutdown before the application exits.
Parameters:
Returns:
tenantId
public T tenantId(String tenantId)
Sets the tenant ID of the application.
Parameters:
Returns: