1

I'm writing a client that uses the google-oauth-java-client. In my code, I need to extend the Credential (com.google.api.client.auth.oauth2.Credential) class and to override the method:

boolean handleResponse(com.google.api.client.http.HttpRequest request, com.google.api.client.http.HttpResponse response,boolean supportsRetry)

Unfortunately this method shares a lock in Credential with many other methods, there is no method to access it and the visibility of the attribute is private. Nevertheless, the class mentions explicitly in the comments and documentation: "Subclasses may override". How is the correct way to extend this class taking into account this lock?

I would like to force a refresh of the token when an error 400 is produced in very a very particular situation, besides the actual 401 so I think I should use the lock.

Néstor
  • 11
  • 2

0 Answers0