public class OnBehalfOfCredentialBuilder extends AadCredentialBuilderBase<OnBehalfOfCredentialBuilder>
OnBehalfOfCredential
.OnBehalfOfCredential
Constructor and Description |
---|
OnBehalfOfCredentialBuilder() |
Modifier and Type | Method and Description |
---|---|
OnBehalfOfCredential |
build()
Creates a new
OnBehalfOfCredential with the current configurations. |
OnBehalfOfCredentialBuilder |
clientSecret(String clientSecret)
Sets the client secret for the authentication.
|
OnBehalfOfCredentialBuilder |
pfxCertificate(String certificatePath,
String clientCertificatePassword)
Sets the path and password of the PFX certificate for authenticating to AAD.
|
OnBehalfOfCredentialBuilder |
regionalAuthority(RegionalAuthority regionalAuthority)
Specifies either the specific regional authority, or use
RegionalAuthority.AUTO_DISCOVER_REGION to
attempt to auto-detect the region. |
OnBehalfOfCredentialBuilder |
sendCertificateChain(boolean sendCertificateChain)
Specifies if the x5c claim (public key of the certificate) should be sent as part of the authentication request
and enable subject name / issuer based authentication.
|
OnBehalfOfCredentialBuilder |
tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)
Configures the persistent shared token cache options and enables the persistent token cache which is disabled
by default.
|
OnBehalfOfCredentialBuilder |
userAssertion(String userAssertion)
Configure the User Assertion Scope to be used for OnBehalfOf Authentication request.
|
authorityHost, clientId, executorService, tenantId
allowMultiTenantAuthentication, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
public OnBehalfOfCredentialBuilder clientSecret(String clientSecret)
clientSecret
- the secret value of the AAD application.public OnBehalfOfCredentialBuilder tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)
tokenCachePersistenceOptions
- the token cache configuration optionspublic OnBehalfOfCredentialBuilder pfxCertificate(String certificatePath, String clientCertificatePassword)
certificatePath
- the password protected PFX file containing the certificateclientCertificatePassword
- the password protecting the PFX filepublic OnBehalfOfCredentialBuilder sendCertificateChain(boolean sendCertificateChain)
sendCertificateChain
- the flag to indicate if certificate chain should be sent as part of authentication
request.public OnBehalfOfCredentialBuilder regionalAuthority(RegionalAuthority regionalAuthority)
RegionalAuthority.AUTO_DISCOVER_REGION
to
attempt to auto-detect the region. If unset, a non-regional authority will be used. This argument should be used
only by applications deployed to Azure VMs.regionalAuthority
- the regional authoritypublic OnBehalfOfCredentialBuilder userAssertion(String userAssertion)
userAssertion
- the user assertion access token to be used for On behalf Of authentication flowpublic OnBehalfOfCredential build()
OnBehalfOfCredential
with the current configurations.OnBehalfOfCredential
with the current configurations.IllegalArgumentException
- if eiter both the client secret and certificate are configured or none of them
are configured.Copyright © 2021 Microsoft Corporation. All rights reserved.