Package com.azure.identity
Class UsernamePasswordCredentialBuilder
- java.lang.Object
-
- com.azure.identity.CredentialBuilderBase<T>
-
- com.azure.identity.AadCredentialBuilderBase<UsernamePasswordCredentialBuilder>
-
- com.azure.identity.UsernamePasswordCredentialBuilder
-
public class UsernamePasswordCredentialBuilder extends AadCredentialBuilderBase<UsernamePasswordCredentialBuilder>
Fluent credential builder for instantiating aUsernamePasswordCredential
.- See Also:
UsernamePasswordCredential
-
-
Constructor Summary
Constructors Constructor Description UsernamePasswordCredentialBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UsernamePasswordCredential
build()
Creates a newUsernamePasswordCredential
with the current configurations.UsernamePasswordCredentialBuilder
password(String password)
Sets the password of the user.UsernamePasswordCredentialBuilder
tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)
Configures the persistent shared token cache options and enables the persistent token cache which is disabled by default.UsernamePasswordCredentialBuilder
username(String username)
Sets the username of the user.-
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 UsernamePasswordCredentialBuilder username(String username)
Sets the username of the user.- Parameters:
username
- the username of the user- Returns:
- the UserCredentialBuilder itself
-
password
public UsernamePasswordCredentialBuilder password(String password)
Sets the password of the user.- Parameters:
password
- the password of the user- Returns:
- the UserCredentialBuilder itself
-
tokenCachePersistenceOptions
public UsernamePasswordCredentialBuilder 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 UsernamePasswordCredential build()
Creates a newUsernamePasswordCredential
with the current configurations.- Returns:
- a
UsernamePasswordCredential
with the current configurations.
-
-