This file contains hidden or 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
guido@Firefly:~/work$ tree | |
. | |
└── path | |
└── to | |
└── symlink -> /home/guido/work | |
3 directories, 0 files |
This file contains hidden or 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
package com.example; | |
import org.junit.jupiter.api.AfterEach; | |
import org.junit.jupiter.api.BeforeEach; | |
import org.junit.jupiter.api.Test; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |
This file contains hidden or 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
[Manager] | |
# Limit maximum of open files | |
DefaultLimitNOFILE=65535 |
This file contains hidden or 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
#<domain> <type> <item> <value> | |
guido soft nofile 2048 | |
guido hard nofile 10240 |
This file contains hidden or 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
@Bean | |
public static SAMLBootstrap samlBootstrap() { | |
// return new SAMLBootstrap(); | |
return new SamlBootstrapSha256(); | |
} |
This file contains hidden or 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
public class SamlBootstrapSha256 extends SAMLBootstrap { | |
@Override | |
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) | |
throws BeansException { | |
super.postProcessBeanFactory(beanFactory); | |
BasicSecurityConfiguration config = | |
(BasicSecurityConfiguration) Configuration.getGlobalSecurityConfiguration(); |
This file contains hidden or 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
@Bean | |
public KeyManager keyManager() { | |
DefaultResourceLoader loader = new DefaultResourceLoader(); | |
Resource storeFile = loader.getResource("classpath:/saml/samlKeystore.jks"); | |
String storePass = "secure"; | |
Map<String, String> passwords = new HashMap<>(); | |
passwords.put("samuraj", "secure"); | |
String defaultKey = "samuraj"; | |
return new JKSKeyManager(storeFile, storePass, passwords, defaultKey); |
This file contains hidden or 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
@Bean | |
public FilterChainProxy samlFilter() throws Exception { | |
List<SecurityFilterChain> chains = new ArrayList<SecurityFilterChain>(); | |
chains.add(new DefaultSecurityFilterChain( | |
new AntPathRequestMatcher("/saml/login/**"), | |
samlEntryPoint())); | |
chains.add(new DefaultSecurityFilterChain( | |
new AntPathRequestMatcher("/saml/logout/**"), | |
samlLogoutFilter())); |
This file contains hidden or 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
@Configuration | |
@EnableWebSecurity | |
public class SecurityConfiguration extends WebSecurityConfigurerAdapter { | |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http.csrf() | |
.disable(); | |
http | |
.addFilterBefore(metadataGeneratorFilter(), ChannelProcessingFilter.class) |
This file contains hidden or 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
ext { | |
springVersion = '5.0.2.RELEASE' | |
springSecurityVersion = '5.0.0.RELEASE' | |
springSamlVersion = '1.0.3.RELEASE' | |
} | |
dependencies { | |
implementation "org.springframework:spring-webmvc:${springVersion}" | |
implementation "org.springframework.security:spring-security-web:${springSecurityVersion}" | |
implementation "org.springframework.security:spring-security-config:${springSecurityVersion}" |