This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:apereo/wsfed-sample-java-webapp
- Loading branch information
Showing
16 changed files
with
178 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.sh text eol=lf | ||
gradlew text eol=lf | ||
*.java text eol=lf | ||
*.xml text eol=lf | ||
*.properties text eol=lf | ||
*.txt text eol=lf | ||
*.json text eol=lf | ||
*.html text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.gradle | ||
build/ | ||
.idea | ||
classes | ||
*.iml | ||
bin/ | ||
.classpath | ||
.project | ||
.settings/ | ||
.vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-5.5 KB
WEB-INF/classes/org/apache/cxf/fediz/example/FederationServlet.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
19 changes: 19 additions & 0 deletions
19
src/main/java/org/apereo/cas/ClassLoaderLeakPreventorListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.apereo.cas; | ||
|
||
import org.slf4j.bridge.SLF4JBridgeHandler; | ||
|
||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
/** | ||
* Extend ClassLoaderLeakPreventorListener to override standard logger (route it to slf4j) so we can control logging. | ||
* This might risk classloader leak but we just want threads stopped. | ||
*/ | ||
public class ClassLoaderLeakPreventorListener | ||
extends se.jiderhamn.classloader.leak.prevention.ClassLoaderLeakPreventorListener { | ||
static { | ||
SLF4JBridgeHandler.removeHandlersForRootLogger(); | ||
SLF4JBridgeHandler.install(); | ||
Logger.getLogger("").setLevel(Level.FINEST); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,97 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<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_3_0.xsd" | ||
version="3.0" metadata-complete="true"> | ||
|
||
<description>WS Federation Spring Example</description> | ||
<display-name>WS Federation Spring Example</display-name> | ||
|
||
<filter> | ||
<filter-name>springSecurityFilterChain</filter-name> | ||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> | ||
</filter> | ||
|
||
<!-- Optional: Cache the security token in Thread Local Storage --> | ||
<filter> | ||
<filter-name>FederationFilter</filter-name> | ||
<filter-class>org.apache.cxf.fediz.core.servlet.FederationFilter</filter-class> | ||
</filter> | ||
|
||
<filter-mapping> | ||
<filter-name>springSecurityFilterChain</filter-name> | ||
<url-pattern>/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<filter-mapping> | ||
<filter-name>FederationFilter</filter-name> | ||
<url-pattern>/secure/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<context-param> | ||
<param-name>contextConfigLocation</param-name> | ||
<param-value>/WEB-INF/applicationContext-security.xml</param-value> | ||
</context-param> | ||
|
||
<listener> | ||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> | ||
</listener> | ||
|
||
<servlet> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<servlet-class>org.apereo.cas.FederationServlet</servlet-class> | ||
</servlet> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/admin/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/user/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/manager/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
</web-app> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
<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_3_0.xsd" | ||
version="3.0" metadata-complete="true"> | ||
|
||
<description>WS Federation Spring Example</description> | ||
<display-name>WS Federation Spring Example</display-name> | ||
|
||
<context-param> | ||
<param-name>contextConfigLocation</param-name> | ||
<param-value>/WEB-INF/applicationContext-security.xml</param-value> | ||
</context-param> | ||
|
||
<context-param> | ||
<param-name>ClassLoaderLeakPreventor.threadWaitMs</param-name> | ||
<param-value>100</param-value> | ||
</context-param> | ||
|
||
<context-param> | ||
<param-name>ClassLoaderLeakPreventor.shutdownHookWaitMs</param-name> | ||
<param-value>200</param-value> | ||
</context-param> | ||
|
||
<filter> | ||
<filter-name>springSecurityFilterChain</filter-name> | ||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> | ||
</filter> | ||
|
||
<!-- Optional: Cache the security token in Thread Local Storage --> | ||
<filter> | ||
<filter-name>FederationFilter</filter-name> | ||
<filter-class>org.apache.cxf.fediz.core.servlet.FederationFilter</filter-class> | ||
</filter> | ||
|
||
<filter-mapping> | ||
<filter-name>springSecurityFilterChain</filter-name> | ||
<url-pattern>/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<filter-mapping> | ||
<filter-name>FederationFilter</filter-name> | ||
<url-pattern>/secure/*</url-pattern> | ||
</filter-mapping> | ||
|
||
<!--ClassLoaderLeakPreventorListener should be first (outermost) listener--> | ||
<listener> | ||
<listener-class>org.apereo.cas.ClassLoaderLeakPreventorListener</listener-class> | ||
</listener> | ||
|
||
<listener> | ||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> | ||
</listener> | ||
|
||
<servlet> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<servlet-class>org.apereo.cas.FederationServlet</servlet-class> | ||
</servlet> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/admin/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/user/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
<servlet-mapping> | ||
<servlet-name>FederationServlet</servlet-name> | ||
<url-pattern>/secure/manager/fedservlet</url-pattern> | ||
</servlet-mapping> | ||
|
||
</web-app> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | ||
<HTML> | ||
<HEAD> | ||
<TITLE>WS Federation Sample Web Application</TITLE> | ||
<META http-equiv=Content-Type content="text/html"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" type="text/javascript"></script> | ||
</HEAD> | ||
<body> | ||
|
||
<div class="container"> | ||
<div class="p-5 mb-4 bg-light rounded-3"> | ||
<div class="container-fluid py-5"> | ||
<h1 class="display-5 fw-bold">WS Federation Sample Web Application</h1> | ||
<p class="col-md-8 fs-4">This is a sample application that acts as a WS Federation client using Apache Fediz.</p> | ||
<p><a id="logincas" class="btn btn-lg btn-success" href="/fediz/secure/fedservlet" role="button">Login with CAS</a></p> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</HTML> | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | ||
<HTML lang="en"> | ||
<HEAD> | ||
<TITLE>WS Federation Sample Web Application</TITLE> | ||
<META http-equiv=Content-Type content="text/html"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" type="text/javascript"></script> | ||
</HEAD> | ||
<body> | ||
|
||
<div class="container"> | ||
<div class="p-5 mb-4 bg-light rounded-3"> | ||
<div class="container-fluid py-5"> | ||
<h1 class="display-5 fw-bold">WS Federation Sample Web Application</h1> | ||
<p class="col-md-8 fs-4">This is a sample application that acts as a WS Federation client using Apache Fediz.</p> | ||
<p><a id="logincas" class="btn btn-lg btn-success" href="/fediz/secure/fedservlet" role="button">Login with CAS</a></p> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</HTML> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters