Skip to content

Instantly share code, notes, and snippets.

2014-11-17 21:14:10.504 DEBUG [http-nio-8080-exec-1] HttpSessionRequestCache : DefaultSavedRequest added to Session: DefaultSavedRequest[http://localhost:8080/home]
2014-11-17 21:14:10.504 DEBUG [http-nio-8080-exec-1] ExceptionTranslationFilter : Calling Authentication entry point.
2014-11-17 21:14:10.505 DEBUG [http-nio-8080-exec-1] DefaultRedirectStrategy : Redirecting to 'http://localhost:8080/vaultLogin'
2014-11-17 21:14:10.505 DEBUG [http-nio-8080-exec-1] HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2014-11-17 21:14:10.505 DEBUG [http-nio-8080-exec-1] SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
2014-11-17 21:14:10.514 DEBUG [http-nio-8080-exec-2] OAuth2ClientAuthenticationProcessingFilter : Request is to process authentication
2014-11-17 21:14:10.536 DEBUG [http-nio-8080-exec-2] DefaultRedirectStrategy : Redirecting to 'http://localhost:3000/oauth/authorize?c
@yterradas
yterradas / gist:631014badf9950c2ad6b
Created October 21, 2014 22:09
google style xml config for Intellij
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="google-style">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
@yterradas
yterradas / gist:0fe2ab41081e9a676f3e
Created August 24, 2014 06:45
Custom filter added to spring security filter chain.
@Configuration
@EnableWebMvcSecurity
public class WebSecurityConfig
extends WebSecurityConfigurerAdapter {
@Value("${oauth.check_token.url:http://localhost:3030/oauth/token/info}")
private String checkTokenUrl;
@Autowired @Qualifier("restTemplate")
private RestOperations authRestTemplate;
@yterradas
yterradas / gist:7e95378640eeb597ce33
Last active January 30, 2018 14:06
Override AnonymousAuthenticationFilter with a custom implementation.
@Configuration
@EnableWebMvcSecurity
public class WebSecurityConfig
extends WebSecurityConfigurerAdapter {
@Value("${oauth.check_token.url:http://localhost:3030/oauth/token/info}")
private String checkTokenUrl;
@Autowired @Qualifier("restTemplate")
private RestOperations authRestTemplate;
http.addFilterBefore(customAuthFilter(), SecurityContextPersistenceFilter.class)
.authorizeRequests()
.antMatchers("/**")
.authenticated()
.and()
.exceptionHandling().disable()
.sessionManagement().disable()
.rememberMe().disable()
.x509().disable()
.headers().disable()
@yterradas
yterradas / gist:494bc99ce81fd5a139d8
Last active August 29, 2015 14:03
spring-boot and mybatis working together, without the stinking help of mybatis-spring.
@Bean SqlSessionFactory sqlSessionFactory() {
TransactionFactory transactionFactory = new JdbcTransactionFactory();
Environment environment = new Environment("dev", transactionFactory, dataSource());
Configuration configuration = new Configuration(environment);
// NOTE: you must register aliases before adding mappers.
configuration.getTypeAliasRegistry().registerAlias(MyClazz.class);
// NOTE: you can add a package where your mappers reside or add one at a time.