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 aAuthorizationCodeCredential.- See Also:
AuthorizationCodeCredential
-
-
Constructor Summary
Constructors Constructor Description AuthorizationCodeCredentialBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthorizationCodeCredentialBuilderauthorizationCode(String authCode)Sets the authorization code on the builder.AuthorizationCodeCredentialbuild()Creates a newAuthorizationCodeCredentialwith the current configurations.AuthorizationCodeCredentialBuilderclientSecret(String clientSecret)Sets the client secret for the authentication.AuthorizationCodeCredentialBuilderredirectUrl(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
authorityHost, clientId, executorService, tenantId
-
Methods inherited from class com.azure.identity.CredentialBuilderBase
configuration, enableAccountIdentifierLogging, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeout
-
-
-
-
Method Detail
-
authorizationCode
public AuthorizationCodeCredentialBuilder authorizationCode(String authCode)
Sets the authorization code on the builder.- Parameters:
authCode- the authorization code acquired from user login- Returns:
- the AuthorizationCodeCredentialBuilder itself
-
redirectUrl
public AuthorizationCodeCredentialBuilder 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. The authorization code will be sent to this URL, so it must be listening on this server and is able to complete theAuthorizationCodeCredentialconstruction 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
public AuthorizationCodeCredentialBuilder clientSecret(String 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
public AuthorizationCodeCredential build()
Creates a newAuthorizationCodeCredentialwith the current configurations.- Returns:
- a
AuthorizationCodeCredentialwith the current configurations.
-
-