Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
b4184b12
Commit
b4184b12
authored
1 year ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-13533: Disable SSO servlet by default
parent
3fb8926f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server-application-server/source/java/ch/ethz/sis/openbis/generic/server/SingleSignOnServlet.java
+9
-0
9 additions, 0 deletions
.../ethz/sis/openbis/generic/server/SingleSignOnServlet.java
with
9 additions
and
0 deletions
server-application-server/source/java/ch/ethz/sis/openbis/generic/server/SingleSignOnServlet.java
+
9
−
0
View file @
b4184b12
...
@@ -84,6 +84,8 @@ public class SingleSignOnServlet extends AbstractServlet
...
@@ -84,6 +84,8 @@ public class SingleSignOnServlet extends AbstractServlet
public
static
final
String
DEFAULT_REDIRECT_URL
=
"webapp/eln-lims"
;
public
static
final
String
DEFAULT_REDIRECT_URL
=
"webapp/eln-lims"
;
private
static
final
String
SINGLE_SIGN_ON_ENABLED_PROPERTY
=
"single-sign-on.enabled"
;
private
static
final
String
SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE_PROPERTY
=
"single-sign-on.redirect-url-template"
;
private
static
final
String
SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE_PROPERTY
=
"single-sign-on.redirect-url-template"
;
private
static
final
String
DEFAULT_SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE
=
"https://${host}/openbis/webapp/eln-lims"
;
private
static
final
String
DEFAULT_SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE
=
"https://${host}/openbis/webapp/eln-lims"
;
...
@@ -103,9 +105,12 @@ public class SingleSignOnServlet extends AbstractServlet
...
@@ -103,9 +105,12 @@ public class SingleSignOnServlet extends AbstractServlet
private
Template
template
;
private
Template
template
;
private
boolean
enabled
;
@Override
@Override
protected
void
initServletContext
(
ServletContext
servletContext
)
protected
void
initServletContext
(
ServletContext
servletContext
)
{
{
enabled
=
Boolean
.
parseBoolean
(
configurer
.
getResolvedProps
().
getProperty
(
SINGLE_SIGN_ON_ENABLED_PROPERTY
,
Boolean
.
toString
(
Boolean
.
FALSE
)));
template
=
new
Template
(
configurer
.
getResolvedProps
().
getProperty
(
SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE_PROPERTY
,
template
=
new
Template
(
configurer
.
getResolvedProps
().
getProperty
(
SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE_PROPERTY
,
DEFAULT_SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE
));
DEFAULT_SINGLE_SIGN_ON_REDIRECT_URL_TEMPLATE
));
template
.
createFreshCopy
().
bind
(
"host"
,
""
);
// Check that template contains '${host}'
template
.
createFreshCopy
().
bind
(
"host"
,
""
);
// Check that template contains '${host}'
...
@@ -116,6 +121,10 @@ public class SingleSignOnServlet extends AbstractServlet
...
@@ -116,6 +121,10 @@ public class SingleSignOnServlet extends AbstractServlet
protected
void
respondToRequest
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
,
IOException
protected
void
respondToRequest
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
,
IOException
{
{
operationLog
.
info
(
"handle sso event"
);
operationLog
.
info
(
"handle sso event"
);
if
(!
enabled
)
{
response
.
setStatus
(
HttpServletResponse
.
SC_FORBIDDEN
);
return
;
}
removeStaleSessions
();
removeStaleSessions
();
String
sessionId
=
getHeader
(
request
,
SESSION_ID_KEY
,
DEFAULT_SESSION_ID_KEY
);
String
sessionId
=
getHeader
(
request
,
SESSION_ID_KEY
,
DEFAULT_SESSION_ID_KEY
);
synchronized
(
this
)
synchronized
(
this
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment