Spring Security“#oauth2.xxx”表达式现在无法使用

时间:2020-03-18 23:37:17

标签: spring-security spring-security-oauth2

自从我从spring-security-oauth迁移到spring-securty以来,我无法解决此问题:

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests()
            .antMatchers("/secure/me").access("#oauth2.isUser()")
            .antMatchers("/secure/**").access("#oauth2.isClient()")
            .and()
            .oauth2ResourceServer().jwt();
}

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>

请注意,我需要区分何时是用户令牌还是client_credentials令牌。我发现找不到#oauth2.xxx。 有人有同样的情况吗?您如何设法解决这个问题? 谢谢...

0 个答案:

没有答案
相关问题