Java Code Examples for org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer#expressionHandler()

The following examples show how to use org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer#expressionHandler() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OAuth2ClientConfig.java    From open-capacity-platform with Apache License 2.0 6 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {

	if (jwtTokenStore != null) {
		resources.tokenStore(jwtTokenStore);
	} else if (redisTokenStore != null) {
		resources.tokenStore(redisTokenStore);
	}
	resources.stateless(true);

	resources.authenticationEntryPoint(authenticationEntryPoint);

	resources.expressionHandler(expressionHandler);
	resources.accessDeniedHandler(oAuth2AccessDeniedHandler);

}
 
Example 2
Source File: ResourceServerConfiguration.java    From fw-cloud-framework with MIT License 5 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
	// 认证回调
	resources.expressionHandler(expressionHandler);
	// 访问异常回到
	resources.accessDeniedHandler(accessDeniedHandler);
}
 
Example 3
Source File: SecurityConfiguration.java    From nakadi with MIT License 5 votes vote down vote up
@Override
public void configure(final ResourceServerSecurityConfigurer resources) throws Exception {
    final OAuth2AuthenticationEntryPoint oAuth2AuthenticationEntryPoint = new OAuth2AuthenticationEntryPoint();
    oAuth2AuthenticationEntryPoint.setExceptionRenderer(new ProblemOauthExceptionRenderer());
    resources.authenticationEntryPoint(oAuth2AuthenticationEntryPoint);
    resources.tokenServices(tokenServices);
    resources.expressionHandler(new ExtendedOAuth2WebSecurityExpressionHandler());
    final OAuth2AccessDeniedHandler oAuth2AccessDeniedHandler = new OAuth2AccessDeniedHandler();
    oAuth2AccessDeniedHandler.setExceptionRenderer(new ProblemOauthExceptionRenderer());
    resources.accessDeniedHandler(oAuth2AccessDeniedHandler);
}
 
Example 4
Source File: ResourceServerConfiguration.java    From open-cloud with MIT License 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    // 构建redis获取token服务类
    resources.tokenServices(OpenHelper.buildRedisTokenServices(redisConnectionFactory));
    resources.expressionHandler(expressionHandler);
}
 
Example 5
Source File: ResourceServerConfiguration.java    From Taroco with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
    resources.expressionHandler(expressionHandler);
    resources.accessDeniedHandler(accessDeniedHandler);
    resources.authenticationEntryPoint(exceptionEntryPoint);
}
 
Example 6
Source File: ResourceServerConfiguration.java    From pig with MIT License 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
    resources.expressionHandler(expressionHandler);
    resources.accessDeniedHandler(pigAccessDeniedHandler);
}
 
Example 7
Source File: PcResourceServerConfig.java    From paascloud-master with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
	resources.expressionHandler(pcSecurityExpressionHandler);
}
 
Example 8
Source File: OAuthConfiguration.java    From pazuzu-registry with MIT License 4 votes vote down vote up
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
    // here is the important part for stups-expression-handler
    resources.expressionHandler(new ExtendedOAuth2WebSecurityExpressionHandler());
}
 
Example 9
Source File: OAuth2Configuration.java    From fullstop with Apache License 2.0 4 votes vote down vote up
@Override
public void configure(final ResourceServerSecurityConfigurer resources) throws Exception {
    // add support for #oauth2.hasUidScopeAndAnyRealm() expressions
    resources
            .expressionHandler(new ExtendedOAuth2WebSecurityExpressionHandler());
}