本文整理汇总了Java中org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter.setApplicationEventPublisher方法的典型用法代码示例。如果您正苦于以下问题:Java OAuth2ClientAuthenticationProcessingFilter.setApplicationEventPublisher方法的具体用法?Java OAuth2ClientAuthenticationProcessingFilter.setApplicationEventPublisher怎么用?Java OAuth2ClientAuthenticationProcessingFilter.setApplicationEventPublisher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter
的用法示例。
在下文中一共展示了OAuth2ClientAuthenticationProcessingFilter.setApplicationEventPublisher方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: oauth2SsoFilter
import org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter; //导入方法依赖的package包/类
private OAuth2ClientAuthenticationProcessingFilter oauth2SsoFilter(
OAuth2SsoProperties sso) {
OAuth2RestOperations restTemplate = this.applicationContext
.getBean(UserInfoRestTemplateFactory.class).getUserInfoRestTemplate();
ResourceServerTokenServices tokenServices = this.applicationContext
.getBean(ResourceServerTokenServices.class);
OAuth2ClientAuthenticationProcessingFilter filter = new OAuth2ClientAuthenticationProcessingFilter(
sso.getLoginPath());
filter.setRestTemplate(restTemplate);
filter.setTokenServices(tokenServices);
filter.setApplicationEventPublisher(this.applicationContext);
return filter;
}
示例2: ssoFilter
import org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter; //导入方法依赖的package包/类
private OAuth2ClientAuthenticationProcessingFilter ssoFilter(String provideName,
ClientResources clientResources) {
OAuth2ClientAuthenticationProcessingFilter filter =
new OAuth2ClientAuthenticationProcessingFilter(format("/login/%s", provideName));
filter.setRestTemplate(new OAuth2RestTemplate(clientResources.getClient(), oauth2ClientContext));
filter.setTokenServices(new UserInfoTokenServices(clientResources.getResource().getUserInfoUri(),
clientResources.getClient().getClientId()));
filter.setApplicationEventPublisher(applicationEventPublisher);
return filter;
}
示例3: ssoFilter
import org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter; //导入方法依赖的package包/类
private Filter ssoFilter(ClientResources client, String path, String provider) {
OAuth2ClientAuthenticationProcessingFilter oAuth2ClientAuthenticationFilter = new OAuth2ClientAuthenticationProcessingFilter(
path);
OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(client.getClient(), oauth2ClientContext);
oAuth2ClientAuthenticationFilter.setRestTemplate(oAuth2RestTemplate);
CustomTokenService tokenServices = new CustomTokenService(client.getResource().getUserInfoUri(),
client.getClient().getClientId(), provider);
tokenServices.setRestTemplate(oAuth2RestTemplate);
oAuth2ClientAuthenticationFilter.setTokenServices(tokenServices);
oAuth2ClientAuthenticationFilter.setApplicationEventPublisher(applicationEventPublisher);
return oAuth2ClientAuthenticationFilter;
}