You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
google-oauth-java-client version: from 1.14.1-beta to the current version in master (2019/01/15)
Steps to reproduce
I would like to extend the class Credential (com.google.api.client.auth.oauth2.Credential) 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.
Besides this, HttpResponse is final so I cannot make an extension of this class to override the method getStatusCode neither and change the returned status code.
External references such as API reference guides used
If the lock in Credential is not accessible from the classes that extend it, I think a template method that allows full override of the method should be available:
Environment details
Steps to reproduce
I would like to extend the class Credential (com.google.api.client.auth.oauth2.Credential) 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.
Besides this, HttpResponse is final so I cannot make an extension of this class to override the method getStatusCode neither and change the returned status code.
External references such as API reference guides used
https://github.com/googleapis/google-oauth-java-client/blob/master/google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/Credential.java
https://developers.google.com/api-client-library/java/google-oauth-java-client/reference/1.20.0/com/google/api/client/auth/oauth2/Credential
Any additional information below
If the lock in Credential is not accessible from the classes that extend it, I think a template method that allows full override of the method should be available:
The text was updated successfully, but these errors were encountered: