Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idp-cookieservlet
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
et-public
IT Lab
idp-cookieservlet
Commits
359fa46b
Commit
359fa46b
authored
6 years ago
by
Scotty Logan
Browse files
Options
Downloads
Patches
Plain Diff
added JSPs
parent
a8bef3c8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/webapp/WEB-INF/web.xml
+10
-9
10 additions, 9 deletions
src/main/webapp/WEB-INF/web.xml
src/main/webapp/idp.jsp
+38
-0
38 additions, 0 deletions
src/main/webapp/idp.jsp
src/main/webapp/x509.jsp
+66
-0
66 additions, 0 deletions
src/main/webapp/x509.jsp
with
114 additions
and
9 deletions
src/main/webapp/WEB-INF/web.xml
+
10
−
9
View file @
359fa46b
...
@@ -5,25 +5,26 @@
...
@@ -5,25 +5,26 @@
version=
"3.1"
>
version=
"3.1"
>
<display-name>
IdP Cookie Clearing Servlet
</display-name>
<display-name>
IdP Cookie Clearing Servlet
</display-name>
<servlet>
<servlet>
<servlet-name>
clearIdpCookieServlet
</servlet-name>
<servlet-name>
idp_cookie
</servlet-name>
<servlet-class>
edu.stanford.itlab.shibboleth.ClearIdpCookieServlet
</servlet-class>
<jsp-file>
/idp.jsp
</jsp-file>
<load-on-startup>
1
</load-on-startup>
</servlet>
</servlet>
<servlet-mapping>
<servlet-mapping>
<servlet-name>
clearIdpCookieServlet
</servlet-name>
<servlet-name>
idp_cookie
</servlet-name>
<url-pattern>
/idp
</url-pattern>
<url-pattern>
/idp
</url-pattern>
</servlet-mapping>
</servlet-mapping>
<!-- manage x509passthrough cookie -->
<servlet>
<servlet>
<servlet-name>
setX509CookieServlet
</servlet-name>
<servlet-name>
x509_cookie
</servlet-name>
<servlet-class>
edu.stanford.itlab.shibboleth.SetX509CookieServlet
</servlet-class>
<jsp-file>
/x509.jsp
</jsp-file>
<load-on-startup>
1
</load-on-startup>
</servlet>
</servlet>
<servlet-mapping>
<servlet-mapping>
<servlet-name>
setX
509
C
ookie
Servlet
</servlet-name>
<servlet-name>
x
509
_c
ookie
</servlet-name>
<url-pattern>
/x509
</url-pattern>
<url-pattern>
/x509
</url-pattern>
</servlet-mapping>
</servlet-mapping>
</web-app>
</web-app>
This diff is collapsed.
Click to expand it.
src/main/webapp/idp.jsp
0 → 100644
+
38
−
0
View file @
359fa46b
<%@ page
import=
"javax.servlet.http.Cookie"
%>
<%
/**
* Simplified IdP Cookie Clearer
*/
final
Cookie
c1
=
new
Cookie
(
"shib_idp_session"
,
"1"
);
final
Cookie
c2
=
new
Cookie
(
"shib_idp_session"
,
"1"
);
c1
.
setPath
(
"/"
);
c1
.
setSecure
(
true
);
c1
.
setMaxAge
(
0
);
c2
.
setPath
(
"/idp"
);
c2
.
setSecure
(
true
);
c2
.
setMaxAge
(
0
);
response
.
addCookie
(
c1
);
response
.
addCookie
(
c2
);
%>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
IdP Session
</title>
<link
href=
"/css/certificate.css"
rel=
"stylesheet"
>
</head>
<body>
<div
class=
"box box-warning"
>
<h2>
Session Cleared
</h2>
<p>
Your session with this IdP has been terminated.
</p>
</div>
</body>
</html>
This diff is collapsed.
Click to expand it.
src/main/webapp/x509.jsp
0 → 100644
+
66
−
0
View file @
359fa46b
<%@ page
import=
"javax.servlet.http.Cookie"
%>
<%
/**
* Simplified X509 Cookie Setter
*/
final
String
action
=
request
.
getParameter
(
"action"
);
String
location
=
"/cookie/x509"
;
boolean
x509_enabled
=
false
;
Cookie
c_x509
=
new
Cookie
(
"x509passthrough"
,
"1"
);
String
error
=
null
;
int
max_age
=
-
1
;
c_x509
.
setPath
(
"/"
);
c_x509
.
setSecure
(
true
);
if
(
action
==
null
||
action
.
equals
(
"enable"
))
{
max_age
=
5
*
365
*
86400
;
// enable for 5 years
}
else
if
(
action
.
equals
(
"disable"
))
{
max_age
=
0
;
// disable
}
else
{
error
=
"Invalid action: "
+
action
;
}
if
(
max_age
>
=
0
)
{
c_x509
.
setMaxAge
(
max_age
);
response
.
addCookie
(
c_x509
);
}
%>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Client Certificate
</title>
<link
href=
"/css/certificate.css"
rel=
"stylesheet"
>
</head>
<body>
<%
if
(
error
!=
null
)
{
%>
<div
class=
"box box-error"
>
<h2>
Error!
</h2>
<p><%=
error
%></p>
</div>
<%
}
else
if
(
max_age
>
0
)
{
%>
<div
class=
"box box-success"
>
<h2>
Cookie Enabled
</h2>
<p>
Client certificate authentication should now be enabled for this browser.
</p>
<div
class=
"action"
>
<p><a
href=
"?action=disable"
class=
"btn btn-warning"
>
Disable Certificate Authentication
</a></p>
</div>
</div>
<%
}
else
if
(
max_age
==
0
)
{
%>
<div
class=
"box box-warning"
>
<h2>
Cookie Disabled
</h2>
<p>
Client certificate authentication should now be disabled for this browser.
</p>
<div
class=
"action"
>
<p><a
href=
"?action=enable"
class=
"btn btn-success"
>
Enable Certificate Authentication
</a></p>
</div>
</div>
<%
}
%>
</body>
</html>
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