0

I have a problem about creating a user in auth service through api gateway or not.

When I make a request from auth service to "/authenticate/signup" , I got the error message named "Full authentication is required to access this resource".

When I make a request to the same url "/authenticate/signup" through api gateway, I got a message named "Could not send request".

How can I fix the issue.

Where is the problem in auth service and api gateway?

I implemented this process through jwt token and refresh token.

Here is the project link : Link

S.N
  • 2,157
  • 3
  • 29
  • 78

1 Answers1

0

Can you try this

.authorizeRequests(auth -> {
            auth.anyRequest().authenticated();
          })
          .authorizeRequests()
          .antMatchers("/authenticate/signup","/authenticate/login", "/authenticate/refreshtoken")
          .permitAll()
          .and()

WARNING: If you are configuring WebSecurity to ignore requests, consider using permitAll via HttpSecurity#authorizeHttpRequests instead. See the configure Javadoc for additional details.

https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter

ALex
  • 673
  • 1
  • 6
  • 19
  • I get this issue now. Here is the link : https://stackoverflow.com/questions/74304377/spring-cloud-api-gateway-jwt-issue-java-lang-classnotfoundexception-javax-xml-b – S.N Nov 05 '22 at 22:45
  • I have got another issue related with it in security config in order service or api gateway. Can you look through it? https://stackoverflow.com/questions/74462679/spring-boot-microservice-security-defined-in-the-service-always-return-403 – S.N Nov 16 '22 at 21:56
  • Can you look through my another question if you don't mind? Here is the link : https://stackoverflow.com/questions/74586470/spring-boot-microservices-spring-cloud-403-forbidden-among-services-control – S.N Nov 28 '22 at 23:01
  • I have a similar issue but I cannot fix it. Can you help me if you have any idea about it? Here is the link : https://stackoverflow.com/questions/74843944/spring-boot-microservices-rest-template-401-unauthorized-error – S.N Dec 18 '22 at 23:07