oauth2resttemplate

OAuth2RestTemplate with Ribbon + Eureka

旧城冷巷雨未停 提交于 2020-07-30 04:21:12
问题 I am working on microservices with Spring Cloud and Netflix OSS Eureka and Ribbon. I have another service running as oauth-server which provides OAuth2 token. All my microservices are registered with Eureka including oauth-server. My whole solution works if I use hardcoded url of oauth-server as "clientCredentialsResourceDetails.setAccessTokenUri("http://localhost:9000/oauth/token");" but when I try to use Eureka Discovered url of oauth-server like "clientCredentialsResourceDetails

OAuth2RestTemplate with Ribbon + Eureka

ⅰ亾dé卋堺 提交于 2020-07-30 04:18:13
问题 I am working on microservices with Spring Cloud and Netflix OSS Eureka and Ribbon. I have another service running as oauth-server which provides OAuth2 token. All my microservices are registered with Eureka including oauth-server. My whole solution works if I use hardcoded url of oauth-server as "clientCredentialsResourceDetails.setAccessTokenUri("http://localhost:9000/oauth/token");" but when I try to use Eureka Discovered url of oauth-server like "clientCredentialsResourceDetails

How to pass API exception output to through own REST service?

旧时模样 提交于 2019-12-13 03:33:06
问题 Summary : I want to pass valid exception output given by one REST service end point to the end user by using my own Rest service. What I did is, I have called that service in service class using RestTemplate class, it's giving valid output on valid post request. But when I am passing invalid input to it I am getting only '400 BAD REQUEST' result in my service class where I have called that API. But when I am calling that API separately using postman, there I'm getting expected output. Code