How to bypass authentication/authorization on a resource using JHipster microservice + gateway?

665 Views Asked by At

We are implementing microservices with JHipster and we have a scenario where we need a specific resource in one of our microservices to be available via Gateway without the need for authorization/authentication. What sort of configuration should be done in the microservice app or gateway in order to achieve such behavior?

1

There are 1 best solutions below

0
Ehsan Moradi On

You need to give access to the resource on that microservice, so the resource is accessible from the gateway without authentication. In you microservice, edit SecuritConfiguration exclude service from .antMatchers("/api/**").authenticated() and add ,for example, .antMatchers("/api/service1").permitAll() line before that.