mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
saml distro and examples
This commit is contained in:
20
examples/saml/post-basic/src/main/webapp/WEB-INF/picketlink.xml
Executable file
20
examples/saml/post-basic/src/main/webapp/WEB-INF/picketlink.xml
Executable file
@@ -0,0 +1,20 @@
|
||||
<PicketLink xmlns="urn:picketlink:identity-federation:config:2.1">
|
||||
<PicketLinkSP xmlns="urn:picketlink:identity-federation:config:2.1"
|
||||
ServerEnvironment="tomcat" BindingType="POST">
|
||||
<IdentityURL>${idp.url::http://localhost:8080/auth/realms/saml-demo/protocol/saml}</IdentityURL>
|
||||
<ServiceURL>${sales-post.url::http://localhost:8080/sales-post/}</ServiceURL>
|
||||
<Trust>
|
||||
<Domains>localhost,jboss.com,jboss.org,amazonaws.com</Domains>
|
||||
</Trust>
|
||||
</PicketLinkSP>
|
||||
<Handlers xmlns="urn:picketlink:identity-federation:handler:config:2.1">
|
||||
<Handler
|
||||
class="org.picketlink.identity.federation.web.handlers.saml2.SAML2IssuerTrustHandler" />
|
||||
<Handler
|
||||
class="org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler" />
|
||||
<Handler
|
||||
class="org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler" />
|
||||
<Handler
|
||||
class="org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler" />
|
||||
</Handlers>
|
||||
</PicketLink>
|
||||
52
examples/saml/post-basic/src/main/webapp/WEB-INF/web.xml
Normal file
52
examples/saml/post-basic/src/main/webapp/WEB-INF/web.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
version="2.5">
|
||||
|
||||
<display-name>PicketLink Sales Service Provider</display-name>
|
||||
|
||||
<description>PicketLink Service Provider With a Basic Configuration using SAML HTTP POST Binding</description>
|
||||
|
||||
<!-- Define a Security Constraint on this Application -->
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>SALES Application</web-resource-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</web-resource-collection>
|
||||
<auth-constraint>
|
||||
<role-name>manager</role-name>
|
||||
</auth-constraint>
|
||||
</security-constraint>
|
||||
|
||||
<!-- Define a security constraint that gives unlimted access to freezone -->
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>freezone</web-resource-name>
|
||||
<url-pattern>/freezone/*</url-pattern>
|
||||
</web-resource-collection>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>images</web-resource-name>
|
||||
<url-pattern>/images/*</url-pattern>
|
||||
</web-resource-collection>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>css</web-resource-name>
|
||||
<url-pattern>/css/*</url-pattern>
|
||||
</web-resource-collection>
|
||||
</security-constraint>
|
||||
|
||||
<!-- Define the Login Configuration for this Application -->
|
||||
<login-config>
|
||||
<auth-method>FORM</auth-method>
|
||||
<realm-name>Tomcat SALES Application</realm-name>
|
||||
<form-login-config>
|
||||
<form-login-page>/jsp/login.jsp</form-login-page>
|
||||
<form-error-page>/jsp/loginerror.jsp</form-error-page>
|
||||
</form-login-config>
|
||||
</login-config>
|
||||
|
||||
<!-- Security roles referenced by this web application -->
|
||||
<security-role>
|
||||
<description>The role that is required to log in to the Manager Application</description>
|
||||
<role-name>manager</role-name>
|
||||
</security-role>
|
||||
</web-app>
|
||||
78
examples/saml/post-basic/src/main/webapp/css/idp.css
Normal file
78
examples/saml/post-basic/src/main/webapp/css/idp.css
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
~ JBoss, Home of Professional Open Source.
|
||||
~ Copyright (c) 2011, Red Hat, Inc., and individual contributors
|
||||
~ as indicated by the @author tags. See the copyright.txt file in the
|
||||
~ distribution for a full listing of individual contributors.
|
||||
~
|
||||
~ This is free software; you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Lesser General Public License as
|
||||
~ published by the Free Software Foundation; either version 2.1 of
|
||||
~ the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
~ Lesser General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Lesser General Public
|
||||
~ License along with this software; if not, write to the Free
|
||||
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
||||
*/
|
||||
body {
|
||||
background: url(images/rh_bg.png) repeat-x scroll 0 0 #F3F3F3;
|
||||
color: #555555;
|
||||
font: 12px/1.4 "Lucida Sans Unicode", "Lucida Grande", sans-serif;
|
||||
}
|
||||
|
||||
.loginBox {
|
||||
position:absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width:30em;
|
||||
height:3em;
|
||||
margin-top: -9em; /*set to a negative number 1/2 of your height*/
|
||||
margin-left: -15em; /*set to a negative number 1/2 of your width*/
|
||||
border: 1px solid #ccc;
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 50em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #5e8a9a;
|
||||
}
|
||||
|
||||
h1 {
|
||||
padding-top: 20px;
|
||||
color: #7b1e1e;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
color: #8ec6d9;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-left: 230px;
|
||||
}
|
||||
|
||||
.dualbrand {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.as7 {
|
||||
float: left;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.note {
|
||||
font-size: 8pt;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
43
examples/saml/post-basic/src/main/webapp/error.jsp
Normal file
43
examples/saml/post-basic/src/main/webapp/error.jsp
Normal file
@@ -0,0 +1,43 @@
|
||||
<!--
|
||||
~ JBoss, Home of Professional Open Source.
|
||||
~ Copyright (c) 2011, Red Hat, Inc., and individual contributors
|
||||
~ as indicated by the @author tags. See the copyright.txt file in the
|
||||
~ distribution for a full listing of individual contributors.
|
||||
~
|
||||
~ This is free software; you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Lesser General Public License as
|
||||
~ published by the Free Software Foundation; either version 2.1 of
|
||||
~ the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
~ Lesser General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Lesser General Public
|
||||
~ License along with this software; if not, write to the Free
|
||||
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>PicketLink Example Application</title>
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
<link rel="StyleSheet" href="css/idp.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<img src="images/picketlink-banner-1180px.png"
|
||||
style="margin-top: -10px; margin-left: -10px; opacity: 0.4; filter: alpha(opacity = 40);" />
|
||||
<div class="loginBox"
|
||||
style="margin-bottom: 80px; border: 1px solid #000000; width: 440px; background-color: #F8F8F8; align: center;">
|
||||
<center>
|
||||
<p>
|
||||
<b>The Service Provider could not process the request.</b>
|
||||
</p>
|
||||
</center>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
examples/saml/post-basic/src/main/webapp/favicon.ico
Normal file
BIN
examples/saml/post-basic/src/main/webapp/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
examples/saml/post-basic/src/main/webapp/images/bkg.gif
Normal file
BIN
examples/saml/post-basic/src/main/webapp/images/bkg.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
BIN
examples/saml/post-basic/src/main/webapp/images/rh_bg.png
Normal file
BIN
examples/saml/post-basic/src/main/webapp/images/rh_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 577 B |
14
examples/saml/post-basic/src/main/webapp/index.jsp
Normal file
14
examples/saml/post-basic/src/main/webapp/index.jsp
Normal file
@@ -0,0 +1,14 @@
|
||||
<div align="center">
|
||||
<h1>SalesTool</h1>
|
||||
<br/>
|
||||
Welcome to the Sales Tool, <%=request.getUserPrincipal().getName()%>
|
||||
|
||||
<br/>
|
||||
Here is your sales chart:
|
||||
<br/>
|
||||
<img src="piechart.gif"/>
|
||||
|
||||
<br/>
|
||||
<a href="?GLO=true">Click to LogOut</a>
|
||||
|
||||
</div>
|
||||
44
examples/saml/post-basic/src/main/webapp/logout.jsp
Normal file
44
examples/saml/post-basic/src/main/webapp/logout.jsp
Normal file
@@ -0,0 +1,44 @@
|
||||
<!--
|
||||
~ JBoss, Home of Professional Open Source.
|
||||
~ Copyright (c) 2011, Red Hat, Inc., and individual contributors
|
||||
~ as indicated by the @author tags. See the copyright.txt file in the
|
||||
~ distribution for a full listing of individual contributors.
|
||||
~
|
||||
~ This is free software; you can redistribute it and/or modify it
|
||||
~ under the terms of the GNU Lesser General Public License as
|
||||
~ published by the Free Software Foundation; either version 2.1 of
|
||||
~ the License, or (at your option) any later version.
|
||||
~
|
||||
~ This software is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
~ Lesser General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Lesser General Public
|
||||
~ License along with this software; if not, write to the Free
|
||||
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
||||
-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>PicketLink Example Application</title>
|
||||
<META HTTP-EQUIV="refresh" CONTENT="1;URL=<%= request.getContextPath() %>">
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
<link rel="StyleSheet" href="css/idp.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<img src="images/picketlink-banner-1180px.png"
|
||||
style="margin-top: -10px; margin-left: -10px; opacity: 0.4; filter: alpha(opacity = 40);" />
|
||||
<div class="loginBox"
|
||||
style="margin-bottom: 80px; border: 1px solid #000000; width: 440px; background-color: #F8F8F8; align: center;">
|
||||
<center>
|
||||
<p>
|
||||
<b>Logout in progress. You will be redirected to the Login Page.</b>
|
||||
</p>
|
||||
</center>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
examples/saml/post-basic/src/main/webapp/piechart.gif
Normal file
BIN
examples/saml/post-basic/src/main/webapp/piechart.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Reference in New Issue
Block a user