本文整理汇总了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;
}
示例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;
}
示例3: AuthWithoutOAuthConfiguration
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Autowired
AuthWithoutOAuthConfiguration(
ResourceServerProperties resourceServerProperties,
PreAuthenticationFailureFilter preAuthenticationFailureFilter
) {
this.resourceServerProperties = resourceServerProperties;
this.preAuthenticationFailureFilter = preAuthenticationFailureFilter;
}
示例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;
}
示例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());
}
示例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();
}
示例8: googleResource
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties("google.resource")
public ResourceServerProperties googleResource() {
return new ResourceServerProperties();
}
示例9: resourceServerProperties
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
public ResourceServerProperties resourceServerProperties(){
return new ResourceServerProperties();
}
示例10: getResource
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
public ResourceServerProperties getResource() {
return resource;
}
示例11: getResource
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
public ResourceServerProperties getResource() {
return resource;
}
示例12: ResourceServerConfiguration
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
public ResourceServerConfiguration(ResourceServerProperties resource,
CustomOAuth2AuthenticationManager customOAuth2AuthenticationManager) {
this.resource = resource;
this.customOAuth2AuthenticationManager = customOAuth2AuthenticationManager;
}
示例13: eveResource
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
@ConfigurationProperties("eve.resource")
protected ResourceServerProperties eveResource()
{
return new ResourceServerProperties();
}
示例14: resourceServerProperties
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties; //导入依赖的package包/类
@Bean
public ResourceServerProperties resourceServerProperties() {
return new ResourceServerProperties();
}