mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
realm token precedence over conf token
This commit is contained in:
parent
91cb537559
commit
941794fb7a
1 changed files with 5 additions and 6 deletions
|
|
@ -65,17 +65,16 @@ public class UserTokenContainer {
|
|||
}
|
||||
|
||||
public String getUserToken(String principal) {
|
||||
// Case of user use token instead of authentication.
|
||||
//TODO(khalid): in case of hub realm, remote token should take precedence over default
|
||||
if (!StringUtils.isBlank(defaultToken)) {
|
||||
return defaultToken;
|
||||
}
|
||||
String token = userTokens.get(principal);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
String ticket = UserSessionContainer.instance.getSession(principal);
|
||||
try {
|
||||
token = getDefaultZeppelinInstanceToken(ticket);
|
||||
if (!StringUtils.isBlank(token)) {
|
||||
if (StringUtils.isBlank(token)) {
|
||||
if (!StringUtils.isBlank(defaultToken)) {
|
||||
token = defaultToken;
|
||||
}
|
||||
} else {
|
||||
userTokens.putIfAbsent(principal, token);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue