Questions tagged [oauth2resttemplate]

26 questions
0
votes
1 answer

How to switch to a service user when using Spring Oauth2RestTemplate

I am trying to use Spring's Oauth2RestTemplate, but we need it to use some super user when making a Rest call (we have the user defined), rather than it passing through the user that originally made the service call. So here's the situation: userA…
Sean
  • 139
  • 1
  • 1
  • 15
0
votes
0 answers

Getting error org.springframework.http.converter.HttpMessageNotReadableException:Can not construct instance of java.time.LocalDate

I am trying to do the Rest Get call using oAuth2RestTemplate.getForEntity to service and expecting json reply to be mapped in one of my model class but as the mapping class uses local date (Java 8 concept) I am getting the below error at the time of…
0
votes
1 answer

OAuth2RestTemplate with Ribbon + Eureka

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…
0
votes
0 answers

Why does the JdbcClientTokenServices not save refresh tokens?

I have a Spring application that acts as an OAuth2 client. I implemented a JdbcClientTokenServices to persist the tokens for each user that succesfully authenticates. @Bean public OAuth2RestTemplate restTemplate(OAuth2ClientContext clientContext) { …
0
votes
1 answer

Persisting the refresh token of the Spring OAuth2RestTemplate

I have a mobile application that uses my Spring Boot backend for things like authentication and accessing data. A part of the Spring Boot application accesses data from a resource server using OAuth2. I stumbled across an oauth2 client library for…
0
votes
1 answer

Spring Traverson and OAuth2RestTemplate

I have an OAuth2RestTemplate to handle the communication with a REST-API and just tried to use this in combination with a Traverson, like so: @Bean public Traverson traverson( final OAuth2RestTemplate restTemplate ) { try { final Traverson…
Torgeist
  • 524
  • 4
  • 13
0
votes
2 answers

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

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…
0
votes
0 answers

OAuth2RestTemplate.postForEntity RestClientException: No HttpMessageConverter for [org.x.xx] and content type [application/json]

I'm using OAuth2RestTemplate to query an external api that accept a JSON object. HttpHeaders headers = new HttpHeaders(); headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); HttpEntity request = new HttpEntity<>(xX,…
0
votes
2 answers

Spring Boot OAuth2RestTemplate and HTTP Client Metrics

Actuator manages the instrumentation of RestTemplate, we only have to inject RestTemplateBuilder to create RestTemplate bean: @Configuration public class HttpClientConfiguration { private final RestTemplateBuilder restTemplateBuilder; //…
0
votes
1 answer

OAuth2RestTemplate for Salesforce is giving error - HTTP 400 Bad Request

I am trying to integrate Spring Boot with Salesforce using OAuth2RestTemplate but it is giving me Access token denied error even though credentials are correct. Upon debugging I found that Salesforce is sending 400 HTTP status code. package…
0
votes
1 answer

Change OAuth2RestTemplate HTTP method in Client Credentials flow

I have a Resource Server with resources / secured API endpoints that my service needs to send requests to. To do that I need an OAuth Token from an Authorization server that's gives token on Client Credentials kind of authentication when doing a GET…
OchiengOlanga
  • 135
  • 1
  • 3
  • 11
1
2