Skip to content

Instantly share code, notes, and snippets.

@bvulaj
Last active May 22, 2018 18:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
@Autowired
private PrincipalExtractor principalExtractor;
private Filter ssoFilter() {
OAuth2ClientAuthenticationProcessingFilter facebookFilter = new OAuth2ClientAuthenticationProcessingFilter("/login/facebook");
OAuth2RestTemplate facebookTemplate = new OAuth2RestTemplate(facebook(), oauth2ClientContext);
facebookFilter.setRestTemplate(facebookTemplate);
UserInfoTokenServices tokenServices = new UserInfoTokenServices(facebookResource().getUserInfoUri(), facebook().getClientId());
tokenServices.setRestTemplate(facebookTemplate);
tokenServices.setPrincipalExtractor(principalExtractor);
facebookFilter.setTokenServices(tokenServices);
return facebookFilter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment