public static Filter general(AuthorizationCodeResourceDetails client, ResourceServerProperties resourceServerProperties, String path, OAuth2ClientContext oauth2ClientContext) {
OAuth2ClientAuthenticationProcessingFilter oAuth2ClientAuthenticationFilter = new OAuth2ClientAuthenticationProcessingFilter(path){
protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response,
FilterChain chain, Authentication authResult) throws IOException, ServletException {
super.successfulAuthentication(request, response, chain, authResult);
OAuth2AccessToken accessToken = restTemplate.getAccessToken();
log.warn(new Gson().toJson(authResult));
log.warn(new Gson().toJson(accessToken));
}
};
OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(client, oauth2ClientContext);
oAuth2ClientAuthenticationFilter.setRestTemplate(oAuth2RestTemplate);
UserInfoTokenServices tokenServices = new UserInfoTokenServices(resourceServerProperties.getUserInfoUri(), client.getClientId());
tokenServices.setRestTemplate(oAuth2RestTemplate);
oAuth2ClientAuthenticationFilter.setTokenServices(tokenServices);
return oAuth2ClientAuthenticationFilter;
}
java类org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties的实例源码
OAuth2Util.java 文件源码
项目:DAFramework
阅读 37
收藏 0
点赞 0
评论 0
OAuth2Util.java 文件源码
项目:DAFramework
阅读 50
收藏 0
点赞 0
评论 0
public static Filter wechat(AuthorizationCodeResourceDetails client, ResourceServerProperties resourceServerProperties, String path, OAuth2ClientContext oauth2ClientContext) {
OAuth2ClientAuthenticationProcessingFilter oAuth2ClientAuthenticationFilter = new OAuth2ClientAuthenticationProcessingFilter(path);
OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(client, oauth2ClientContext);
AuthorizationCodeAccessTokenProvider accessTokenProvider = new AuthorizationCodeAccessTokenProvider();
accessTokenProvider.setAuthorizationRequestEnhancer((request, resource, form, headers) -> {
form.set("appid", resource.getClientId());
form.set("secret", resource.getClientSecret());
form.set("scope", "snsapi_userinfo");
form.set("response_type", "code");
form.set("#wechat_redirect", "");
});
accessTokenProvider.setMessageConverters(converters());
oAuth2RestTemplate.setAccessTokenProvider(accessTokenProvider);
oAuth2RestTemplate.setRetryBadAccessTokens(true);
oAuth2ClientAuthenticationFilter.setRestTemplate(oAuth2RestTemplate);
UserInfoTokenServices tokenServices = new UserInfoTokenServices(resourceServerProperties.getUserInfoUri(), client.getClientId());
tokenServices.setRestTemplate(oAuth2RestTemplate);
oAuth2ClientAuthenticationFilter.setTokenServices(tokenServices);
return oAuth2ClientAuthenticationFilter;
}
AuthWithoutOAuthConfiguration.java 文件源码
项目:credhub
阅读 28
收藏 0
点赞 0
评论 0
@Autowired
AuthWithoutOAuthConfiguration(
ResourceServerProperties resourceServerProperties,
PreAuthenticationFailureFilter preAuthenticationFailureFilter
) {
this.resourceServerProperties = resourceServerProperties;
this.preAuthenticationFailureFilter = preAuthenticationFailureFilter;
}
AuthConfiguration.java 文件源码
项目:credhub
阅读 31
收藏 0
点赞 0
评论 0
@Autowired
AuthConfiguration(
ResourceServerProperties resourceServerProperties,
AuditOAuth2AuthenticationExceptionHandler auditOAuth2AuthenticationExceptionHandler,
AuditOAuth2AccessDeniedHandler auditOAuth2AccessDeniedHandler,
PreAuthenticationFailureFilter preAuthenticationFailureFilter,
OAuth2ExtraValidationFilter oAuth2ExtraValidationFilter
) {
this.resourceServerProperties = resourceServerProperties;
this.auditOAuth2AuthenticationExceptionHandler = auditOAuth2AuthenticationExceptionHandler;
this.auditOAuth2AccessDeniedHandler = auditOAuth2AccessDeniedHandler;
this.preAuthenticationFailureFilter = preAuthenticationFailureFilter;
this.oAuth2ExtraValidationFilter = oAuth2ExtraValidationFilter;
}
OAuth2AutoConfiguration.java 文件源码
项目:spring-security-oauth2-boot
阅读 30
收藏 0
点赞 0
评论 0
@Bean
public ResourceServerProperties resourceServerProperties() {
return new ResourceServerProperties(this.credentials.getClientId(),
this.credentials.getClientSecret());
}
OAuth2AutoConfigurationTests.java 文件源码
项目:spring-security-oauth2-boot
阅读 36
收藏 0
点赞 0
评论 0
protected CustomResourceServer(ResourceServerProperties config) {
this.config = config;
}
SecurityConfig.java 文件源码
项目:movie-db-java-on-azure
阅读 33
收藏 0
点赞 0
评论 0
@Bean
@ConfigurationProperties("facebook.resource")
public ResourceServerProperties facebookResource() {
return new ResourceServerProperties();
}
SecurityConfiguration.java 文件源码
项目:emergentmud
阅读 36
收藏 0
点赞 0
评论 0
@Bean
@ConfigurationProperties("facebook.resource")
public ResourceServerProperties facebookResource() {
return new ResourceServerProperties();
}
SecurityConfiguration.java 文件源码
项目:emergentmud
阅读 29
收藏 0
点赞 0
评论 0
@Bean
@ConfigurationProperties("google.resource")
public ResourceServerProperties googleResource() {
return new ResourceServerProperties();
}
GroupRepositoryTest.java 文件源码
项目:Facegram
阅读 38
收藏 0
点赞 0
评论 0
@Bean
public ResourceServerProperties resourceServerProperties(){
return new ResourceServerProperties();
}
UserRepositoryTest.java 文件源码
项目:Facegram
阅读 34
收藏 0
点赞 0
评论 0
@Bean
public ResourceServerProperties resourceServerProperties(){
return new ResourceServerProperties();
}
ClientResources.java 文件源码
项目:sns-todo
阅读 26
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
SecurityConfig.java 文件源码
项目:springboot-security-wechat
阅读 29
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
OAuth2ClientResources.java 文件源码
项目:DAFramework
阅读 30
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
OAuthService.java 文件源码
项目:referenceapp
阅读 38
收藏 0
点赞 0
评论 0
@Bean
@ConfigurationProperties("facebook.resource")
public ResourceServerProperties facebookResource() {
return new ResourceServerProperties();
}
ResourceServerConfiguration.java 文件源码
项目:weazbootgradle
阅读 28
收藏 0
点赞 0
评论 0
public ResourceServerConfiguration(ResourceServerProperties resource,
CustomOAuth2AuthenticationManager customOAuth2AuthenticationManager) {
this.resource = resource;
this.customOAuth2AuthenticationManager = customOAuth2AuthenticationManager;
}
ClientResources.java 文件源码
项目:service-authorization
阅读 36
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
ClientResources.java 文件源码
项目:alpha-umi
阅读 30
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
ClientResources.java 文件源码
项目:spring_boot
阅读 27
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
SecurityConfig.java 文件源码
项目:Robocode
阅读 29
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
EveOAuth2Example.java 文件源码
项目:eve-oauth2-example
阅读 37
收藏 0
点赞 0
评论 0
@Bean
@ConfigurationProperties("eve.resource")
protected ResourceServerProperties eveResource()
{
return new ResourceServerProperties();
}
ClientResources.java 文件源码
项目:spring-boot-magneto
阅读 30
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
OAuth2AutoConfiguration.java 文件源码
项目:https-github.com-g0t4-jenkins2-course-spring-boot
阅读 35
收藏 0
点赞 0
评论 0
@Bean
public ResourceServerProperties resourceServerProperties() {
return new ResourceServerProperties(this.credentials.getClientId(),
this.credentials.getClientSecret());
}
OAuth2AutoConfigurationTests.java 文件源码
项目:https-github.com-g0t4-jenkins2-course-spring-boot
阅读 40
收藏 0
点赞 0
评论 0
protected CustomResourceServer(ResourceServerProperties config) {
this.config = config;
}
UaaClientProperties.java 文件源码
项目:hawkbit-extensions
阅读 27
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
ClientResources.java 文件源码
项目:marketplace
阅读 30
收藏 0
点赞 0
评论 0
public ResourceServerProperties getResource() {
return resource;
}
OAuth2AutoConfiguration.java 文件源码
项目:spring-boot-concourse
阅读 31
收藏 0
点赞 0
评论 0
@Bean
public ResourceServerProperties resourceServerProperties() {
return new ResourceServerProperties(this.credentials.getClientId(),
this.credentials.getClientSecret());
}
OAuth2AutoConfigurationTests.java 文件源码
项目:spring-boot-concourse
阅读 32
收藏 0
点赞 0
评论 0
protected CustomResourceServer(ResourceServerProperties config) {
this.config = config;
}
OAuth2Configuration.java 文件源码
项目:credhub
阅读 32
收藏 0
点赞 0
评论 0
@Bean
public ResourceServerProperties resourceServerProperties() {
return new ResourceServerProperties();
}
OAuth2AutoConfiguration.java 文件源码
项目:contestparser
阅读 31
收藏 0
点赞 0
评论 0
@Bean
public ResourceServerProperties resourceServerProperties() {
return new ResourceServerProperties(this.credentials.getClientId(),
this.credentials.getClientSecret());
}