AbstractClientApplicationBase.Builder<T> Class
- java.
lang. Object - com.
microsoft. aad. msal4j. AbstractApplicationBase. Builder<T> - com.
microsoft. aad. msal4j. AbstractClientApplicationBase. Builder<T>
- com.
- com.
Type Parameters
- T
public abstract static class AbstractClientApplicationBase.Builder
extends Builder<T>
Field Summary
Modifier and Type | Field and Description |
---|---|
protected boolean | isInstanceDiscoveryEnabled |
Constructor Summary
Constructor | Description |
---|---|
Builder(String clientId) |
Constructor to create instance of Builder of client application |
Method Summary
Modifier and Type | Method and Description |
---|---|
T |
aadInstanceDiscoveryResponse(String val)
Sets instance discovery response data which will be used for determining tenant discovery endpoint and authority aliases. |
T |
applicationName(String val)
Sets application name for telemetry purposes |
T |
applicationVersion(String val)
Sets application version for telemetry purposes |
T |
authority(String val)
Set URL of the authenticating authority or security token service (STS) from which MSAL will acquire security tokens. |
T |
autoDetectRegion(boolean val)
Indicates that the library should attempt to discover the Azure region the application is running in when fetching the instance discovery metadata. |
T |
azureRegion(String val)
Set the region that the library will use to format authorities in token requests. |
T |
b2cAuthority(String val)
Set URL of the authenticating B2C authority from which MSAL will acquire tokens Valid B2C authorities should look like: https://<something. |
T | clientCapabilities(Set<String> capabilities) |
T |
instanceDiscovery(boolean val)
Historically, MSAL would connect to a central endpoint located at ``https://login. |
T |
setTokenCacheAccessAspect(ITokenCacheAccessAspect val)
Sets IToken |
T |
validateAuthority(boolean val)
Set a boolean value telling the application if the authority needs to be verified against a list of known authorities. |
Methods inherited from Builder
Methods inherited from java.lang.Object
Field Details
isInstanceDiscoveryEnabled
protected boolean isInstanceDiscoveryEnabled
Constructor Details
Builder
public Builder(String clientId)
Constructor to create instance of Builder of client application
Parameters:
in the application registration portal (portal.azure.com)
Method Details
aadInstanceDiscoveryResponse
public T aadInstanceDiscoveryResponse(String val)
Sets instance discovery response data which will be used for determining tenant discovery endpoint and authority aliases.
Note that authority validation is not done even if AbstractClientApplicationBase#validateAuthority is set to true.
For more information, see https://aka.ms/msal4j-instance-discovery
Parameters:
Returns:
applicationName
public T applicationName(String val)
Sets application name for telemetry purposes
Parameters:
Returns:
applicationVersion
public T applicationVersion(String val)
Sets application version for telemetry purposes
Parameters:
Returns:
authority
public T authority(String val)
Set URL of the authenticating authority or security token service (STS) from which MSAL will acquire security tokens. The default value is AbstractClientApplicationBase#DEFAULT_AUTHORITY
Parameters:
Returns:
Throws:
autoDetectRegion
public T autoDetectRegion(boolean val)
Indicates that the library should attempt to discover the Azure region the application is running in when fetching the instance discovery metadata. Regions can only be detected when running in an Azure environment, such as an Azure VM or other service, or if the environment has environment variable named REGION_NAME configured. Although you can enable both autodetection here and a specific region with AbstractClientApplicationBase#azureRegion at the same time, the region set with AbstractClientApplicationBase#azureRegion will take priority if there is a mismatch. See here for more information about supported scenarios: https://aka.ms/msal4j-azure-regions
Parameters:
Returns:
azureRegion
public T azureRegion(String val)
Set the region that the library will use to format authorities in token requests. If given a valid Azure region, the library will attempt to make token requests at a regional ESTS-R endpoint rather than the global ESTS endpoint. Regions must be valid Azure regions and their short names should be used, such as 'westus' for the West US Azure region, 'centralus' for the Central US Azure region, etc. Although you can set a specific region here and enable autodetection with AbstractClientApplicationBase#autoDetectRegion at the same time the specific region set here will take priority over the autodetected region if there is a mismatch. See here for more information about supported scenarios: https://aka.ms/msal4j-azure-regions
Parameters:
Returns:
b2cAuthority
public T b2cAuthority(String val)
Set URL of the authenticating B2C authority from which MSAL will acquire tokens Valid B2C authorities should look like: https://<something.b2clogin.com// MSAL Java also supports a legacy B2C authority format, which looks like: https:///tfp// However, MSAL Java will eventually stop supporting the legacy format. See here for information on how to migrate to the new format: https://aka.ms/msal4j-b2c
Parameters:
Returns:
Throws:
clientCapabilities
public T clientCapabilities(Set
Parameters:
instanceDiscovery
public T instanceDiscovery(boolean val)
Historically, MSAL would connect to a central endpoint located at ``https://login.microsoftonline.com`` to acquire some metadata, especially when using an unfamiliar authority. This behavior is known as Instance Discovery. This parameter defaults to true, which enables the Instance Discovery. If you do not know some authorities beforehand, yet still want MSAL to accept any authority that you will provide, you can use a ``False`` to unconditionally disable Instance Discovery.
Parameters:
setTokenCacheAccessAspect
public T setTokenCacheAccessAspect(ITokenCacheAccessAspect val)
Sets ITokenCacheAccessAspect to be used for cache_data persistence.
Parameters:
Returns:
validateAuthority
public T validateAuthority(boolean val)
Set a boolean value telling the application if the authority needs to be verified against a list of known authorities. Authority is only validated when: 1 - It is an Azure Active Directory authority (not B2C or ADFS) 2 - Instance discovery metadata is not set via AbstractClientApplicationBase#aadAadInstanceDiscoveryResponse
The default value is true.
Parameters:
Returns: