You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by st...@apache.org on 2019/06/07 17:34:48 UTC

[hadoop] 04/09: HADOOP-15823. ABFS: Stop requiring client ID and tenant ID for MSI

This is an automated email from the ASF dual-hosted git repository.

stevel pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git

commit 3593b666932e16a1be1c4823511617f53d5b5865
Author: Da Zhou <da...@microsoft.com>
AuthorDate: Wed Oct 24 14:18:35 2018 -0700

    HADOOP-15823. ABFS: Stop requiring client ID and tenant ID for MSI
    
    (Contributed by Da Zhou via Daniel Templeton)
    
    Change-Id: I546ab3a1df1efec635c08c388148e718dc4a9843
    (cherry picked from commit e374584479b687e41d5379bb6d827dcae620e123)
---
 .../org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java
index 97415ce..df7b199 100644
--- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java
+++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/AzureADAuthenticator.java
@@ -110,9 +110,6 @@ public final class AzureADAuthenticator {
    */
   public static AzureADToken getTokenFromMsi(String tenantGuid, String clientId,
                                              boolean bypassCache) throws IOException {
-    Preconditions.checkNotNull(tenantGuid, "tenantGuid");
-    Preconditions.checkNotNull(clientId, "clientId");
-
     String authEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token";
 
     QueryParams qp = new QueryParams();
@@ -120,12 +117,12 @@ public final class AzureADAuthenticator {
     qp.add("resource", RESOURCE_NAME);
 
 
-    if (tenantGuid.length() > 0) {
+    if (tenantGuid != null && tenantGuid.length() > 0) {
       String authority = "https://login.microsoftonline.com/" + tenantGuid;
       qp.add("authority", authority);
     }
 
-    if (clientId.length() > 0) {
+    if (clientId != null && clientId.length() > 0) {
       qp.add("client_id", clientId);
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org