我已经设置了一个spring web应用程序,它使用keycloak作为授权服务器。该应用程序配置为使用oauth2Login,要求用户使用keycloak登录。web应用程序也被配置为oauth2Resourceserver,这样它的URL就可以通过在keycloak中定义的角色来保护,这些角色可以从JWT自定义转换为JwtAuthenticationToken。配置如下所示: @Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
我有一堂主修课:
@SpringBootApplication
public class Oauth2Exp {
public static void main(String[] args) {
SpringApplication.run(OauthDemo.class, args);
}
}
还有一个简单的REST端点(检索访问令牌并与字符串"Hello!!“一起输出它):
@RestController
@RequestMapping("/api")
public class SampleRest {
@Autowi
-WSO2 IoT Server 3.1.0RC-I配置ip,创建证书,启动代理服务器,然后启动核心.核心给出错误,我错过了什么?
核心错误- {org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler}签名或消息验证无效。线程"Thread-31“中的异常( org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor.apply(OAuthRequestInterceptor.java:104) at feign.SynchronousMeth