Package com.azure.identity
Class ClientAssertionCredentialBuilder
- java.lang.Object
-
- com.azure.identity.CredentialBuilderBase<T>
-
- com.azure.identity.AadCredentialBuilderBase<ClientAssertionCredentialBuilder>
-
- com.azure.identity.ClientAssertionCredentialBuilder
-
public class ClientAssertionCredentialBuilder extends AadCredentialBuilderBase<ClientAssertionCredentialBuilder>
Fluent credential builder for instantiating aClientAssertionCredential
.- See Also:
ClientAssertionCredential
-
-
Constructor Summary
Constructors Constructor Description ClientAssertionCredentialBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientAssertionCredential
build()
Creates a newClientAssertionCredential
with the current configurations.ClientAssertionCredentialBuilder
clientAssertion(Supplier<String> clientAssertionSupplier)
Sets the supplier containing the logic to supply the client assertion when invoked.ClientAssertionCredentialBuilder
tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)
Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default.-
Methods inherited from class com.azure.identity.AadCredentialBuilderBase
authorityHost, clientId, executorService, tenantId
-
Methods inherited from class com.azure.identity.CredentialBuilderBase
configuration, enableAccountIdentifierLogging, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
-
-
-
-
Method Detail
-
clientAssertion
public ClientAssertionCredentialBuilder clientAssertion(Supplier<String> clientAssertionSupplier)
Sets the supplier containing the logic to supply the client assertion when invoked.- Parameters:
clientAssertionSupplier
- the supplier supplying client assertion.- Returns:
- An updated instance of this builder.
-
tokenCachePersistenceOptions
public ClientAssertionCredentialBuilder tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)
Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default. If configured, the credential will store tokens in a cache persisted to the machine, protected to the current user, which can be shared by other credentials and processes.- Parameters:
tokenCachePersistenceOptions
- the token cache configuration options- Returns:
- An updated instance of this builder with the token cache options configured.
-
build
public ClientAssertionCredential build()
Creates a newClientAssertionCredential
with the current configurations.- Returns:
- a
ClientAssertionCredential
with the current configurations. - Throws:
IllegalArgumentException
- if either of clientId, tenantId or clientAssertion is not present.
-
-