Remove xml config sample
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
package demo.app;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class)
|
||||
@ImportResource("websecurityconfig.xml")
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package demo.app;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
public class MvcConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/home").setViewName("home");
|
||||
registry.addViewController("/").setViewName("home");
|
||||
registry.addViewController("/hello").setViewName("hello");
|
||||
registry.addViewController("/login").setViewName("login");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
server:
|
||||
port: 8080
|
||||
app:
|
||||
service-principal: HTTP/neo.example.org@EXAMPLE.ORG
|
||||
keytab-location: file:///tmp/tomcat.keytab
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||
|
||||
<logger name="org.springframework.security" level="DEBUG"/>
|
||||
|
||||
</configuration>
|
||||
@@ -1,10 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
|
||||
<head>
|
||||
<title>Spring Security Kerberos Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1 th:inline="text">Hello [[${#httpServletRequest.remoteUser}]]!</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
|
||||
<head>
|
||||
<title>Spring Security Kerberos Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome!</h1>
|
||||
<p>Click <a th:href="@{/hello}">here</a> to see a greeting.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
|
||||
<head>
|
||||
<title>Spring Security Kerberos Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<div th:if="${param.error}">
|
||||
Invalid username and password.
|
||||
</div>
|
||||
<div th:if="${param.logout}">
|
||||
You have been logged out.
|
||||
</div>
|
||||
<form th:action="@{/j_spring_security_check}" method="post">
|
||||
<div><label> User Name : <input type="text" name="j_username"/> </label></div>
|
||||
<div><label> Password: <input type="password" name="j_password"/> </label></div>
|
||||
<div><input type="submit" value="Sign In"/></div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:sec="http://www.springframework.org/schema/security"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/security https://www.springframework.org/schema/security/spring-security.xsd
|
||||
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-4.1.xsd
|
||||
http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context-4.1.xsd">
|
||||
|
||||
<sec:http entry-point-ref="spnegoEntryPoint" use-expressions="true" >
|
||||
<sec:intercept-url pattern="/" access="permitAll" />
|
||||
<sec:intercept-url pattern="/home" access="permitAll" />
|
||||
<sec:intercept-url pattern="/login" access="permitAll" />
|
||||
<sec:intercept-url pattern="/**" access="authenticated"/>
|
||||
<sec:form-login login-page="/login" />
|
||||
<sec:custom-filter ref="spnegoAuthenticationProcessingFilter"
|
||||
before="BASIC_AUTH_FILTER" />
|
||||
</sec:http>
|
||||
|
||||
<sec:authentication-manager alias="authenticationManager">
|
||||
<sec:authentication-provider ref="kerberosAuthenticationProvider" />
|
||||
<sec:authentication-provider ref="kerberosServiceAuthenticationProvider" />
|
||||
</sec:authentication-manager>
|
||||
|
||||
<bean id="kerberosAuthenticationProvider"
|
||||
class="org.springframework.security.kerberos.authentication.KerberosAuthenticationProvider">
|
||||
<property name="userDetailsService" ref="dummyUserDetailsService"/>
|
||||
<property name="kerberosClient">
|
||||
<bean class="org.springframework.security.kerberos.authentication.sun.SunJaasKerberosClient">
|
||||
<property name="debug" value="true"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="spnegoEntryPoint"
|
||||
class="org.springframework.security.kerberos.web.authentication.SpnegoEntryPoint" >
|
||||
<constructor-arg value="/login" />
|
||||
</bean>
|
||||
|
||||
<bean id="spnegoAuthenticationProcessingFilter"
|
||||
class="org.springframework.security.kerberos.web.authentication.SpnegoAuthenticationProcessingFilter">
|
||||
<property name="authenticationManager" ref="authenticationManager" />
|
||||
</bean>
|
||||
|
||||
<bean id="kerberosServiceAuthenticationProvider"
|
||||
class="org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider">
|
||||
<property name="ticketValidator">
|
||||
<bean
|
||||
class="org.springframework.security.kerberos.authentication.sun.SunJaasKerberosTicketValidator">
|
||||
<property name="servicePrincipal" value="${app.service-principal}" />
|
||||
<property name="keyTabLocation" value="${app.keytab-location}" />
|
||||
<property name="debug" value="true" />
|
||||
</bean>
|
||||
</property>
|
||||
<property name="userDetailsService" ref="dummyUserDetailsService" />
|
||||
</bean>
|
||||
|
||||
<bean id="dummyUserDetailsService" class="demo.DummyUserDetailsService" />
|
||||
|
||||
</beans>
|
||||
@@ -1,15 +0,0 @@
|
||||
package demo.app;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.SpringApplicationConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration(classes = Application.class)
|
||||
public class ApplicationTest {
|
||||
|
||||
@Test
|
||||
public void configurationLoads() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user