0

i have a problem with FeignClient. Right now, I have authentication & authorization via okta. I have 3 services(one is api-gateway, one is discovery service - Eureka and one is backend). In api-gateway I have declared backend client:

@FeignClient("backend-service")
public interface BackendClient {
    @GetMapping("/api/things")
    ResponseEntity<List<Thing>> getThings();
}

Here is my application.yaml part with feign declared

feign:
    client:
        config:
            default:
                connectTimeout: 160000000
                readTimeout: 160000000
hystrix:
    enabled: false

However, when request is send, I get only

feign.FeignException: status 302 reading BackendClient#getThings()

Do You have any idea does this happen and how to solve it?

Additions: Both services are registered on Eureka, i can check that they exist and they are up and healthy.

Zuul routes are configured properly.

Hubert Bratek
  • 894
  • 10
  • 30
  • are you deploying your application in PCF? If so can you please look at this questions as well: https://stackoverflow.com/questions/47454753/feignexception-status-302-reading-myservicedummy-content – Dhruv Patel Sep 23 '19 at 02:33
  • I have already checked that question. I am not deploying it there. Well, I have checked and made some changes, so right now I see 401 as unauthorized. It looks like that token from (@AuthenticationPrincipal OidcUser user) which I got via user.getIdToken().getTokenValue() is wrong. Should I try to find another one or am I doing something wrong? – Hubert Bratek Sep 23 '19 at 12:30
  • I am hitting Feign client 302 too, did you resolve this issue? – ascetic652 Mar 15 '20 at 19:54

0 Answers0