Package com.azure.identity
Class AuthorizationCodeCredentialBuilder
java.lang.Object
com.azure.identity.CredentialBuilderBase<T>
com.azure.identity.AadCredentialBuilderBase<AuthorizationCodeCredentialBuilder>
com.azure.identity.AuthorizationCodeCredentialBuilder
public class AuthorizationCodeCredentialBuilder
extends AadCredentialBuilderBase<AuthorizationCodeCredentialBuilder>
Fluent credential builder for instantiating a
AuthorizationCodeCredential
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthorizationCode
(String authCode) Sets the authorization code on the builder.build()
Creates a newAuthorizationCodeCredential
with the current configurations.clientSecret
(String clientSecret) Sets the client secret for the authentication.redirectUrl
(String redirectUrl) Sets redirect URL for the Oauth 2.0 login request, which must be registered as a valid redirect URL on the application.Methods inherited from class com.azure.identity.AadCredentialBuilderBase
additionallyAllowedTenants, additionallyAllowedTenants, authorityHost, clientId, executorService, tenantId
Methods inherited from class com.azure.identity.CredentialBuilderBase
configuration, enableAccountIdentifierLogging, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
-
Constructor Details
-
AuthorizationCodeCredentialBuilder
public AuthorizationCodeCredentialBuilder()
-
-
Method Details
-
authorizationCode
Sets the authorization code on the builder.- Parameters:
authCode
- the authorization code acquired from user login- Returns:
- the AuthorizationCodeCredentialBuilder itself
-
redirectUrl
Sets redirect URL for the Oauth 2.0 login request, which must be registered as a valid redirect URL on the application. The authorization code will be sent to this URL, so it must be listening on this server and is able to complete theAuthorizationCodeCredential
construction from there. This is also called Reply URLs in some contexts.- Parameters:
redirectUrl
- the redirect URL to send the authorization code- Returns:
- the AuthorizationCodeCredentialBuilder itself
-
clientSecret
Sets the client secret for the authentication. This is required for AAD web apps. Do not set this for AAD native apps.- Parameters:
clientSecret
- the secret value of the AAD application.- Returns:
- An updated instance of this builder.
-
build
Creates a newAuthorizationCodeCredential
with the current configurations.- Returns:
- a
AuthorizationCodeCredential
with the current configurations.
-