Not able to refresh Oauth2 Token
#140 aperta il 27 ott 2015
Metriche repository
- Star
- (566 star)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
1.Scenario: This App interacts with a backend (Apigee ) services. Apigee has its own access token. The backend Api requires google+ access to return a valid apigee token to the app.
Problem: 2.We are able to get the access token correctly first time by calling Login() of the Plugin. 3.This token is passed to Apigee/ backend and everything works as expected. 4.After 60 minutes the Outh2 expires, the backend validates and returns an error to the app indicating that the token has expired. 5.The app tries to re-fetch a new token by calling login() again. However we intermittently receive the “no valid token error” . Basically the connection fails (GoogleApiClient.connect) and the user has to re-login. We don’t want the user to login every 60 minutes. 6.The above is more prominent if the app is closed and re-launched. The request goes to Apigee, Apigee indicates the token has expired. We try to re-fectch the token by calling login() and we intermittently get the connection error. 7.Is calling the login() correct way to refresh the token in the plugin. What is the right way to fetch the new token via plugin. Any help would be appreciated.