Skip to content

Commit ae6a2de

Browse files
joshelserpetersomogyi
authored andcommitted
HBASE-23709 Unwrap the real user to properly dispatch proxy-user auth'n
REST and Thrift servers started failing because the check in BuiltinProviderSelector wasn't checking the "real" user for kerberos credentials. This resulted in the KerberosAuthnProvider not being invoked when it should have been. Closes #1080 Signed-off-by: Peter Somogyi <psomogyi@apache.org>
1 parent bb56dfa commit ae6a2de

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/security/provider/BuiltInProviderSelector.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,16 @@ public Pair<SaslClientAuthenticationProvider, Token<? extends TokenIdentifier>>
123123
return new Pair<>(digestAuth, token);
124124
}
125125
}
126-
if (user.getUGI().hasKerberosCredentials()) {
126+
// Unwrap PROXY auth'n method if that's what we have coming in.
127+
if (user.getUGI().hasKerberosCredentials() ||
128+
user.getUGI().getRealUser().hasKerberosCredentials()) {
127129
return new Pair<>(krbAuth, null);
128130
}
129-
LOG.debug(
130-
"No matching SASL authentication provider and supporting token found from providers.");
131+
// This indicates that a client is requesting some authentication mechanism which the servers
132+
// don't know how to process (e.g. there is no provider which can support it). This may be
133+
// a bug or simply a misconfiguration of client *or* server.
134+
LOG.warn("No matching SASL authentication provider and supporting token found from providers"
135+
+ " for user: {}", user);
131136
return null;
132137
}
133138

0 commit comments

Comments
 (0)