Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
b0223849
Commit
b0223849
authored
Jul 29, 2018
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2793: updated AtlasClient approach of determining if kerberos…
ATLAS-2793: updated AtlasClient approach of determining if kerberos authentication is enabled or not
parent
50c3adf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
AtlasBaseClient.java
...ommon/src/main/java/org/apache/atlas/AtlasBaseClient.java
+3
-1
AuthenticationUtil.java
.../main/java/org/apache/atlas/utils/AuthenticationUtil.java
+15
-4
No files found.
client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
View file @
b0223849
...
@@ -266,7 +266,9 @@ public abstract class AtlasBaseClient {
...
@@ -266,7 +266,9 @@ public abstract class AtlasBaseClient {
final
URLConnectionClientHandler
handler
;
final
URLConnectionClientHandler
handler
;
if
((
AuthenticationUtil
.
isKerberosAuthenticationEnabled
()))
{
boolean
isKerberosEnabled
=
AuthenticationUtil
.
isKerberosAuthenticationEnabled
(
ugi
);
if
(
isKerberosEnabled
)
{
handler
=
SecureClientUtils
.
getClientConnectionHandler
(
config
,
configuration
,
doAsUser
,
ugi
);
handler
=
SecureClientUtils
.
getClientConnectionHandler
(
config
,
configuration
,
doAsUser
,
ugi
);
}
else
{
}
else
{
if
(
configuration
.
getBoolean
(
TLS_ENABLED
,
false
))
{
if
(
configuration
.
getBoolean
(
TLS_ENABLED
,
false
))
{
...
...
intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java
View file @
b0223849
...
@@ -20,6 +20,7 @@ package org.apache.atlas.utils;
...
@@ -20,6 +20,7 @@ package org.apache.atlas.utils;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.AtlasException
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.hadoop.security.UserGroupInformation
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
java.io.Console
;
import
java.io.Console
;
...
@@ -34,17 +35,27 @@ public final class AuthenticationUtil {
...
@@ -34,17 +35,27 @@ public final class AuthenticationUtil {
}
}
public
static
boolean
isKerberosAuthenticationEnabled
()
{
public
static
boolean
isKerberosAuthenticationEnabled
()
{
boolean
isKerberosAuthenticationEnabled
=
false
;
return
isKerberosAuthenticationEnabled
((
UserGroupInformation
)
null
);
}
public
static
boolean
isKerberosAuthenticationEnabled
(
UserGroupInformation
ugi
)
{
boolean
defaultValue
=
ugi
!=
null
&&
ugi
.
hasKerberosCredentials
();
try
{
try
{
isKerberosAuthenticationEnabled
=
isKerberosAuthenticationEnabled
(
ApplicationProperties
.
get
()
);
return
isKerberosAuthenticationEnabled
(
ApplicationProperties
.
get
(),
defaultValue
);
}
catch
(
AtlasException
e
)
{
}
catch
(
AtlasException
e
)
{
LOG
.
error
(
"Error while isKerberosAuthenticationEnabled "
,
e
);
LOG
.
error
(
"Error while isKerberosAuthenticationEnabled "
,
e
);
}
}
return
isKerberosAuthenticationEnabled
;
return
defaultValue
;
}
}
public
static
boolean
isKerberosAuthenticationEnabled
(
Configuration
atlasConf
)
{
public
static
boolean
isKerberosAuthenticationEnabled
(
Configuration
atlasConf
)
{
return
atlasConf
.
getBoolean
(
"atlas.authentication.method.kerberos"
,
false
);
return
isKerberosAuthenticationEnabled
(
atlasConf
,
false
);
}
public
static
boolean
isKerberosAuthenticationEnabled
(
Configuration
atlasConf
,
boolean
defaultValue
)
{
return
atlasConf
.
getBoolean
(
"atlas.authentication.method.kerberos"
,
defaultValue
);
}
}
public
static
boolean
includeHadoopGroups
(){
public
static
boolean
includeHadoopGroups
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment