EddyVerbruggen/cordova-plugin-googleplus

Not able to refresh Oauth2 Token

Open

#140 opened on Oct 27, 2015

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Java (623 forks)github user discovery
help wanted

Repository metrics

Stars
 (566 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide