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
77dd50c6
Commit
77dd50c6
authored
Jan 11, 2018
by
nixonrodrigues
Committed by
Madhan Neethiraj
Jan 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2352: add configuration to specify validity for authentication token
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
c35f82ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
Authentication-Authorization.twiki
docs/src/site/twiki/Authentication-Authorization.twiki
+1
-0
AtlasAuthenticationFilter.java
...g/apache/atlas/web/filters/AtlasAuthenticationFilter.java
+17
-0
No files found.
docs/src/site/twiki/Authentication-Authorization.twiki
View file @
77dd50c6
...
@@ -65,6 +65,7 @@ Also following properties should be set.
...
@@ -65,6 +65,7 @@ Also following properties should be set.
atlas.authentication.method.kerberos.principal=<principal>/<fqdn>@EXAMPLE.COM
atlas.authentication.method.kerberos.principal=<principal>/<fqdn>@EXAMPLE.COM
atlas.authentication.method.kerberos.keytab = /<key tab filepath>.keytab
atlas.authentication.method.kerberos.keytab = /<key tab filepath>.keytab
atlas.authentication.method.kerberos.name.rules = RULE:[2:$1@$0](atlas@EXAMPLE.COM)s/.*/atlas/
atlas.authentication.method.kerberos.name.rules = RULE:[2:$1@$0](atlas@EXAMPLE.COM)s/.*/atlas/
atlas.authentication.method.kerberos.token.validity = 3600 [ in Seconds (optional)]
</verbatim>
</verbatim>
...
...
webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthenticationFilter.java
View file @
77dd50c6
...
@@ -83,6 +83,7 @@ import java.util.regex.Pattern;
...
@@ -83,6 +83,7 @@ import java.util.regex.Pattern;
public
class
AtlasAuthenticationFilter
extends
AuthenticationFilter
{
public
class
AtlasAuthenticationFilter
extends
AuthenticationFilter
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AtlasAuthenticationFilter
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AtlasAuthenticationFilter
.
class
);
private
static
final
String
CONFIG_KERBEROS_TOKEN_VALIDITY
=
"atlas.authentication.method.kerberos.token.validity"
;
private
static
final
String
CONFIG_PROXY_USERS
=
"atlas.proxyusers"
;
private
static
final
String
CONFIG_PROXY_USERS
=
"atlas.proxyusers"
;
private
static
final
String
PREFIX
=
"atlas.authentication.method"
;
private
static
final
String
PREFIX
=
"atlas.authentication.method"
;
private
static
final
String
[]
DEFAULT_PROXY_USERS
=
new
String
[]
{
"knox"
};
private
static
final
String
[]
DEFAULT_PROXY_USERS
=
new
String
[]
{
"knox"
};
...
@@ -131,6 +132,22 @@ public class AtlasAuthenticationFilter extends AuthenticationFilter {
...
@@ -131,6 +132,22 @@ public class AtlasAuthenticationFilter extends AuthenticationFilter {
headerProperties
=
ConfigurationConverter
.
getProperties
(
configuration
.
subset
(
"atlas.headers"
));
headerProperties
=
ConfigurationConverter
.
getProperties
(
configuration
.
subset
(
"atlas.headers"
));
}
}
String
tokenValidityStr
=
configuration
.
getString
(
CONFIG_KERBEROS_TOKEN_VALIDITY
);
if
(
StringUtils
.
isNotBlank
(
tokenValidityStr
))
{
try
{
Long
tokenValidity
=
Long
.
parseLong
(
tokenValidityStr
);
if
(
tokenValidity
>
0
)
{
params
.
put
(
AuthenticationFilter
.
AUTH_TOKEN_VALIDITY
,
tokenValidity
.
toString
());
}
else
{
throw
new
ServletException
(
tokenValidity
+
": invalid value for property '"
+
CONFIG_KERBEROS_TOKEN_VALIDITY
+
"'. Must be a positive integer"
);
}
}
catch
(
NumberFormatException
e
)
{
throw
new
ServletException
(
tokenValidityStr
+
": invalid value for property '"
+
CONFIG_KERBEROS_TOKEN_VALIDITY
+
"'. Must be a positive integer"
,
e
);
}
}
FilterConfig
filterConfig1
=
new
FilterConfig
()
{
FilterConfig
filterConfig1
=
new
FilterConfig
()
{
@Override
@Override
public
ServletContext
getServletContext
()
{
public
ServletContext
getServletContext
()
{
...
...
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