自从我从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
。
有人有同样的情况吗?您如何设法解决这个问题?
谢谢...