Snowblind Snowblind - 11 months ago 136
Java Question

Jhipster access control policy not working

I'm trying to disable access to all microservice API in one of my gateways. This is because in this gateway I only want to publish the angular app.

I'm trying this, but it don't seems to work:

Debugging the gateway, I see that de
is working and trying to return a FORBIDDEN HttpStatus in the
method, but I get access to the api, and a 200 code response.

Answer Source

If you want to compeltely disable API proxying for all services, the easiest and safest way is to disable Zuul completely and very likely Eureka too by removing @EnableZuulProxy and @EnableDiscoveryClient from your application.

This way your gateway is no longer a gateway, but it would be easier to just serve your angular app from a plain spring boot app or even from nginx.