1

I have a REST API built with Spring Boot and Spring Data JPA repositories (located in a URL A). The problem is that this API is not called directly but called from an API Gateway (located in a URL B) which adds Oauth2 securization to the API.

A consequence of this is that the _links returned in the JSON output of the API refer to the URL A and not the URL B (which is URL the client calls). My question is how I can modify these _links URL to point to the URL of the API Gateway (URL B)?

A solution would be to add Spring Oauth2 directly to the API but I think is very complex and I don't want to refactor from zero the Oauth2 securization.

  • 1
    Possible duplicate of [How to configure Spring HATEOAS behind proxy?](http://stackoverflow.com/questions/30020188/how-to-configure-spring-hateoas-behind-proxy) – a better oliver Feb 25 '17 at 13:34
  • To complete my question I should to point out that the API gateway is a WSO2 API Manager. The proposed duplicated question solved my question partially: the Spring HATEOAS and the X-Forwarded- headers part. – Diego Delgado Feb 28 '17 at 09:01
  • Possible duplicate of [WSO2 API Manager - Replace URLs in response body](http://stackoverflow.com/questions/23893689/wso2-api-manager-replace-urls-in-response-body) – Diego Delgado Feb 28 '17 at 09:18

0 Answers0