在通过api网关在auth服务中创建用户时,我遇到了问题。
当我从auth服务向"/authenticate/signup"
发出请求时,我得到了名为"Full authentication is required to access this resource"
的错误消息。
当我通过api网关向同一个url "/authenticate/signup"
发出请求时,我得到了一个名为"Could not send request"
的消息。
我怎样才能解决这个问题。
auth服务和api网关的问题在哪里?
我通过jwt令牌和刷新令牌实现了这个过程。
下面是项目链接:链接
发布于 2022-11-03 12:07:41
你能试试这个吗?
.authorizeRequests(auth -> {
auth.anyRequest().authenticated();
})
.authorizeRequests()
.antMatchers("/authenticate/signup","/authenticate/login", "/authenticate/refreshtoken")
.permitAll()
.and()
警告:如果您将WebSecurity配置为忽略请求,请考虑通过HttpSecurity#authorizeHttpRequests使用permitAll。有关其他详细信息,请参阅配置Javadoc。
https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter
https://stackoverflow.com/questions/74227914
复制相似问题