Skip to content

Commit

Permalink
Require graph endpoint in authentication file
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghaolu committed Sep 26, 2016
1 parent 163b389 commit 1912b2a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ private enum CredentialSettings {
/** The base URL to the current Azure environment. */
BASE_URL("baseURL"),
/** The URL to Active Directory authentication. */
AUTH_URL("authURL");
AUTH_URL("authURL"),
/** The URL to Active Directory Graph. */
GRAPH_URL("graphURL");

/** The name of the key in the properties file. */
private final String name;
Expand Down Expand Up @@ -143,6 +145,7 @@ public static ApplicationTokenCredentials fromFile(File credentialsFile) throws
final String mgmtUri = authSettings.getProperty(CredentialSettings.MANAGEMENT_URI.toString());
final String authUrl = authSettings.getProperty(CredentialSettings.AUTH_URL.toString());
final String baseUrl = authSettings.getProperty(CredentialSettings.BASE_URL.toString());
final String graphUrl = authSettings.getProperty(CredentialSettings.GRAPH_URL.toString());
final String defaultSubscriptionId = authSettings.getProperty(CredentialSettings.SUBSCRIPTION_ID.toString());

return new ApplicationTokenCredentials(
Expand All @@ -153,7 +156,7 @@ public static ApplicationTokenCredentials fromFile(File credentialsFile) throws
authUrl,
mgmtUri,
baseUrl,
"https://graph.windows.net/") // TODO: cred file should contain GRAPH endpoint
graphUrl)
).withDefaultSubscriptionId(defaultSubscriptionId);
}

Expand Down

0 comments on commit 1912b2a

Please sign in to comment.