sirkitree / angular-directive.g-signin

:triangular_ruler: AngularJS Directive for Google Plus Sign-in Button
http://jeradbitner.com/angular-directive.g-signin/
148 stars 84 forks source link

Token expires too quickly. How do I set the token expiration or request a new one? #51

Closed naphtul closed 8 years ago

naphtul commented 8 years ago

I have implemented this very useful directive in my application. However, if I leave the app open for a while, the next server request tells me that the token is invalid/expired. How do I request a longer-lasting token? Alternatively, how do I refresh the token before every request to my server (that will authenticate its validity against Google servers)?

docsuleman commented 8 years ago

did you find any solution?

naphtul commented 8 years ago

My solution was to use "access" token instead of the "id" token. You can read about it here. https://developers.google.com/identity/protocols/OAuth2UserAgent#formingtheurl Pay attention to the differences between the token types.