Example usage for org.springframework.security.oauth2.provider.expression OAuth2WebSecurityExpressionHandler OAuth2WebSecurityExpressionHandler

List of usage examples for org.springframework.security.oauth2.provider.expression OAuth2WebSecurityExpressionHandler OAuth2WebSecurityExpressionHandler

Introduction

In this page you can find the example usage for org.springframework.security.oauth2.provider.expression OAuth2WebSecurityExpressionHandler OAuth2WebSecurityExpressionHandler.

Prototype

public OAuth2WebSecurityExpressionHandler() 

Source Link

Usage

From source file:nl.capgemini.corpapp.config.OAuth2ResourceServerConfiguration.java

@Override
public void configure(HttpSecurity http) throws Exception {
    // @formatter:off
    http.authorizeRequests().expressionHandler(new OAuth2WebSecurityExpressionHandler())
            .antMatchers("/rest/user/register").anonymous().antMatchers("/rest/**")
            .access("#oauth2.clientHasRole('ROLE_CLIENT') or hasRole('ROLE_USER')").and().requestMatchers()
            .antMatchers("/rest/**");
    // @formatter:on
}