当前位置: 首页>>代码示例>>Java>>正文


Java ResourceServerProperties类代码示例

本文整理汇总了Java中org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties的典型用法代码示例。如果您正苦于以下问题:Java ResourceServerProperties类的具体用法?Java ResourceServerProperties怎么用?Java ResourceServerProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResourceServerProperties类属于org.springframework.boot.autoconfigure.security.oauth2.resource包,在下文中一共展示了ResourceServerProperties类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: general

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
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;
}
 
开发者ID:DataAgg,项目名称:DAFramework,代码行数:18,代码来源:OAuth2Util.java

示例2: wechat

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
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;
}
 
开发者ID:DataAgg,项目名称:DAFramework,代码行数:24,代码来源:OAuth2Util.java

示例3: AuthWithoutOAuthConfiguration

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Autowired
AuthWithoutOAuthConfiguration(
    ResourceServerProperties resourceServerProperties,
    PreAuthenticationFailureFilter preAuthenticationFailureFilter
) {
  this.resourceServerProperties = resourceServerProperties;
  this.preAuthenticationFailureFilter = preAuthenticationFailureFilter;
}
 
开发者ID:cloudfoundry-incubator,项目名称:credhub,代码行数:9,代码来源:AuthWithoutOAuthConfiguration.java

示例4: AuthConfiguration

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@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;
}
 
开发者ID:cloudfoundry-incubator,项目名称:credhub,代码行数:15,代码来源:AuthConfiguration.java

示例5: resourceServerProperties

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
public ResourceServerProperties resourceServerProperties() {
	return new ResourceServerProperties(this.credentials.getClientId(),
			this.credentials.getClientSecret());
}
 
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:6,代码来源:OAuth2AutoConfiguration.java

示例6: CustomResourceServer

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
protected CustomResourceServer(ResourceServerProperties config) {
	this.config = config;
}
 
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:4,代码来源:OAuth2AutoConfigurationTests.java

示例7: facebookResource

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties("facebook.resource")
public ResourceServerProperties facebookResource() {
    return new ResourceServerProperties();
}
 
开发者ID:Microsoft,项目名称:movie-db-java-on-azure,代码行数:6,代码来源:SecurityConfig.java

示例8: googleResource

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties("google.resource")
public ResourceServerProperties googleResource() {
    return new ResourceServerProperties();
}
 
开发者ID:scionaltera,项目名称:emergentmud,代码行数:6,代码来源:SecurityConfiguration.java

示例9: resourceServerProperties

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
public ResourceServerProperties resourceServerProperties(){
    return new ResourceServerProperties();
}
 
开发者ID:nicolasmanic,项目名称:Facegram,代码行数:5,代码来源:GroupRepositoryTest.java

示例10: getResource

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
public ResourceServerProperties getResource() {
    return resource;
}
 
开发者ID:helloworldtang,项目名称:sns-todo,代码行数:4,代码来源:ClientResources.java

示例11: getResource

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
public ResourceServerProperties getResource() {
	return resource;
}
 
开发者ID:DataAgg,项目名称:DAFramework,代码行数:4,代码来源:OAuth2ClientResources.java

示例12: ResourceServerConfiguration

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
public ResourceServerConfiguration(ResourceServerProperties resource,
                                   CustomOAuth2AuthenticationManager customOAuth2AuthenticationManager) {
    this.resource = resource;
    this.customOAuth2AuthenticationManager = customOAuth2AuthenticationManager;
}
 
开发者ID:themadweaz,项目名称:weazbootgradle,代码行数:6,代码来源:ResourceServerConfiguration.java

示例13: eveResource

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties("eve.resource")
protected ResourceServerProperties eveResource()
{
  return new ResourceServerProperties();
}
 
开发者ID:fetox74,项目名称:eve-oauth2-example,代码行数:7,代码来源:EveOAuth2Example.java

示例14: resourceServerProperties

import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
public ResourceServerProperties resourceServerProperties() {
  return new ResourceServerProperties();
}
 
开发者ID:cloudfoundry-incubator,项目名称:credhub,代码行数:5,代码来源:OAuth2Configuration.java


注:本文中的org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。