来自客户端的Spring Security令牌自省

问题描述

我想通过配置Spring Security在给定URI上检查令牌来验证API中收到的令牌。基于我在互联网上看到的内容。我添加了

spring.security.oauth2.resourceserver.jwt.issuer-uri=https://url/protocol/openid-connect/token/introspect

到我的application.properties

我还添加了.oauth2ResourceServer()。jwt();到我的Spring配置,看起来像

   http
                    .csrf().disable().cors()
                    .and()
                    .antMatcher("/api/project/**")
                        .authorizeRequests()
                            .antMatchers("/api/project/projectIds","/api/project/**/involvement").permitAll()
                            .and()
                    .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                    .and()
                    .oauth2ResourceServer().jwt();

当我尝试部署我的应用程序时,出现以下错误:

Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springfra
mework.beans.factory.BeanCreationException: Error creating bean with name 'jwtDecoderByIssuerUri' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OA
uth2ResourceServerJwtConfiguration$JwtDecoderConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instant
iate [org.springframework.security.oauth2.jwt.JwtDecoder]: Factory method 'jwtDecoderByIssuerUri' threw exception; nested exception is java.lang.IllegalArgumentException: Unable to resolve the Configurati
on with the provided Issuer of "https://url/protocol/openid-connect/token/introspect"

我在做什么错了?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...