Skip to content

Commit

Permalink
fix client id inside AzureCliSubscription (#639)
Browse files Browse the repository at this point in the history
* fix client id inside AzureCliSubscription

* AzureCliSubscription: fix checkstyle
  • Loading branch information
xseeseesee authored and jianghaolu committed Oct 15, 2019
1 parent 3db99ed commit d5b30ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ public static AzureCliCredentials create(File azureProfile, File accessTokens) t
* @return the active directory application client id
*/
public String clientId() {
AzureCliSubscription subscription = this.subscriptions.get(defaultSubscriptionId());
return subscription.isServicePrincipal() ? subscription.servicePrincipal().clientId() : subscription.clientId();
return subscriptions.get(defaultSubscriptionId()).clientId();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ boolean isDefault() {
}

String clientId() {
if (isServicePrincipal()) {
return servicePrincipalToken.clientId();
}
return clientId;
}

Expand Down

0 comments on commit d5b30ff

Please sign in to comment.