Package com.azure.identity
Class SharedTokenCacheCredentialBuilder
- java.lang.Object
-
- com.azure.identity.CredentialBuilderBase<T>
-
- com.azure.identity.AadCredentialBuilderBase<SharedTokenCacheCredentialBuilder>
-
- com.azure.identity.SharedTokenCacheCredentialBuilder
-
public class SharedTokenCacheCredentialBuilder extends AadCredentialBuilderBase<SharedTokenCacheCredentialBuilder>
Fluent credential builder for instantiating aSharedTokenCacheCredential.- See Also:
SharedTokenCacheCredential
-
-
Constructor Summary
Constructors Constructor Description SharedTokenCacheCredentialBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SharedTokenCacheCredentialBuilderauthenticationRecord(AuthenticationRecord authenticationRecord)Sets theAuthenticationRecordcaptured from a previous authentication.SharedTokenCacheCredentialbuild()Creates a newSharedTokenCacheCredentialBuilderwith the current configurations.SharedTokenCacheCredentialBuildertokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default.SharedTokenCacheCredentialBuilderusername(String username)Sets the username for the account.-
Methods inherited from class com.azure.identity.AadCredentialBuilderBase
authorityHost, clientId, executorService, tenantId
-
Methods inherited from class com.azure.identity.CredentialBuilderBase
configuration, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
-
-
-
-
Method Detail
-
username
public SharedTokenCacheCredentialBuilder username(String username)
Sets the username for the account.- Parameters:
username- The username for the account.- Returns:
- The updated SharedTokenCacheCredentialBuilder object.
-
tokenCachePersistenceOptions
public SharedTokenCacheCredentialBuilder 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.
-
authenticationRecord
public SharedTokenCacheCredentialBuilder authenticationRecord(AuthenticationRecord authenticationRecord)
Sets theAuthenticationRecordcaptured from a previous authentication.- Parameters:
authenticationRecord- the authentication record to be configured.- Returns:
- An updated instance of this builder with the configured authentication record.
-
build
public SharedTokenCacheCredential build()
Creates a newSharedTokenCacheCredentialBuilderwith the current configurations.- Returns:
- a
SharedTokenCacheCredentialBuilderwith the current configurations.
-
-