Convert oauth2 samples to Java config