Skip to content

Instantly share code, notes, and snippets.

@mikaelhg
Created April 2, 2016 09:41
Show Gist options
  • Select an option

  • Save mikaelhg/850c0e75e5a65119bf908367c7ce4db2 to your computer and use it in GitHub Desktop.

Select an option

Save mikaelhg/850c0e75e5a65119bf908367c7ce4db2 to your computer and use it in GitHub Desktop.
Spring Boot OAuth2 SSO customization notes

org.springframework.boot.autoconfigure.security.oauth2.client.SsoSecurityConfigurer#oauth2SsoFilter

private OAuth2ClientAuthenticationProcessingFilter oauth2SsoFilter(
		OAuth2SsoProperties sso) {
	OAuth2RestOperations restTemplate = this.beanFactory
			.getBean(OAuth2RestOperations.class);
	ResourceServerTokenServices tokenServices = this.beanFactory
			.getBean(ResourceServerTokenServices.class);
	OAuth2ClientAuthenticationProcessingFilter filter = new OAuth2ClientAuthenticationProcessingFilter(
			sso.getLoginPath());
	filter.setRestTemplate(restTemplate);
	filter.setTokenServices(tokenServices);
	return filter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment