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.