Configuring a Java application for local development

The third factor of the Twelve-Factor App methodology promotes storing configuration in the environment rather than in code. To ensure that our code runs correctly we must be able to run the same build artifact in each environment, which…


Spring OAuth authentication on PCF

We can use Spring Boot and Spring Security to create a web application that authenticates users against an OAuth2 provider. Just add spring-boot-starter-web and spring-cloud-starter-oauth2 to your build.gradle file:


Passing CSRF tokens with RestTemplate

Building on my previous post on passing auth headers with RestTemplate we are going to look at using the same approach to pass CSRF tokens in the RestTemplate call.


Testing Auth in Spring apps while using RestTemplate

Usually when you have auth in your Spring app the default for testing becomes MockMvc as most references are using it. I like to use RestTemplate and find it easier to use and test Spring applications. So here is a quick guide on how you…