netflix feign - JHipster AuthorizedFeignClients for microservice to microservice -
i'm using jhipster v4.5.5 , i'm working through examples @ https://jhipster.github.io/using-uaa/. have 2 microservices trying communicate. secured 1 microservice method these annotations:
@secured({authoritiesconstants.user, authoritiesconstants.admin})
i tried contact service microservice using authorizedfeignclients:
@authorizedfeignclient(name = "microservice2") public interface microservice2client { @requestmapping(method = requestmethod.get, value = "/api/demo/string") public string getstring(); ...
when try it, get:
an unexpected error occurred: status 403 reading microservice2client#getstring(); content: {"message":"error.accessdenied","description":"access denied","fielderrors":null}
what credentials / user feignclient trying use? "internal" client defined in application*.yml under jhipster.security.client-authorization settings?
if so, annotations should use on method allow user access rest method?
i prefer user account used , not try use service account. see note in documentation that:
as alternative, access token of initial request may forwarded further calls. currently, there no “default solution” provided jhipster.
how forward access token of original request , forward on?
i setup working set of demo projects here:
Comments
Post a Comment