Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EnvVar AZURE_AUTHORITY_HOST #9392

Merged
merged 7 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ public class Configuration implements Cloneable {
* Name of the Azure cloud to connect to.
*/
public static final String PROPERTY_AZURE_CLOUD = "AZURE_CLOUD";


/**
* The Azure Active Directory endpoint to connect to.
*/
public static final String PROPERTY_AZURE_AUTHORITY_HOST = "AZURE_AUTHORITY_HOST";

/**
* Disables telemetry collection.
*/
Expand Down Expand Up @@ -117,6 +122,7 @@ public class Configuration implements Cloneable {
PROPERTY_AZURE_TENANT_ID,
PROPERTY_AZURE_RESOURCE_GROUP,
PROPERTY_AZURE_CLOUD,
PROPERTY_AZURE_AUTHORITY_HOST,
PROPERTY_AZURE_TELEMETRY_DISABLED,
PROPERTY_AZURE_LOG_LEVEL,
PROPERTY_AZURE_TRACING_DISABLED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.http.HttpPipeline;
import com.azure.core.http.ProxyOptions;
import com.azure.core.util.Configuration;

import java.time.Duration;
import java.util.function.Function;
Expand All @@ -26,7 +27,9 @@ public final class IdentityClientOptions {
* Creates an instance of IdentityClientOptions with default settings.
*/
public IdentityClientOptions() {
authorityHost = DEFAULT_AUTHORITY_HOST;
Configuration configuration = Configuration.getGlobalConfiguration().clone();
Luyunmt marked this conversation as resolved.
Show resolved Hide resolved
authorityHost = configuration.contains(configuration.PROPERTY_AZURE_AUTHORITY_HOST)
? configuration.get(configuration.PROPERTY_AZURE_AUTHORITY_HOST) : DEFAULT_AUTHORITY_HOST;
Luyunmt marked this conversation as resolved.
Show resolved Hide resolved
maxRetry = MAX_RETRY_DEFAULT_LIMIT;
retryTimeout = i -> Duration.ofSeconds((long) Math.pow(2, i.getSeconds() - 1));
}
Expand Down