我还没有找到适当的办法解决我的问题。我正在使用Security Oauth2资源服务器来验证我的请求。效果很好。但是,在不同的情况下测试时,如果不存在授权头,或者如果存在授权头,则spring安全性返回为403,而不是401。如果存在授权头,则该值不会以Bearer开头。
Spring Boot Starter - 2.6.7
Spring Boot Starter Security - 2.6.7
Spring Security Config & Web - 5.6.3
Spring Security Core - 5.3.19
Spring Boot Starter OAuth2
我遵循SpringSecurity5.0官方参考文档和示例代码在我的项目中设置OAuth2/OIDC身份验证,但是它失败了,当我用mvn spring-boot:run启动应用程序时,我得到了以下异常。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientRegistrationRepository'
defined in class path resource [org/springframework/boot/autoco
我尝试创建Oath2注册。
但我知道这个错误:
Caused by: java.lang.IllegalArgumentException: authorizationGrantType cannot be null
at org.springframework.util.Assert.notNull(Assert.java:201) ~[spring-core-5.3.5.jar:5.3.5]
at org.springframework.security.oauth2.client.registration.ClientRegistration$Builder.build(
我们正在尝试使用spring boot构建一个使用oAuth2的自定义身份验证服务器,并使用OAuth2Sso访问多个客户端。同样的代码可以在spring boot版本1.5.6.RELEASE上运行,但不能在2.3.1.RELEASE上运行,在认证握手时不会出现登录屏幕。
ResourceServerConfig代码如下所示
@Configuration
@EnableResourceServer
public class ResourceServerConfig extends WebSecurityConfigurerAdapter {
@Bean
public Au
在学习了Maven Spring Boot中有关微服务和OAuth2的教程后,我遇到了一个问题。我想从身份验证中排除一个请求,这样就可以获得未经授权的数据。这似乎只是在我做的方式中不起作用。有人能帮我一下吗? 我遵循的教程:https://developer.okta.com/blog/2018/02/13/secure-spring-microservices-with-oauth#microservices-architectures-with-spring-boot--spring-cloud 我尝试过的: @Configuration
@EnableResourceServer
pu
试图解决我的申请中的CORS问题。在Spring文档中,我通过设置Csconfigurationsource找到了解决这个问题的方法。但是,在将核心配置源bean添加到SecurityConfig类之后,我得到以下错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'corsConfigurationSource' defined in class path resource [com/amrut/prabhu/oauth2/client/Secur