How to get refresh token while using Google API JS Client -


i have been trying implement app need user grant access google analytics. have been following tutorial:

https://developers.google.com/analytics/solutions/articles/hello-analytics-api

and @ other places there code angularjs uses same functionl

https://gist.github.com/jakemmarsh/5809963

my problem is, auth works pretty well, not return refresh_token. never returns refresh_token. have tried possible available on web. 1. first time, 2. using prompt=force etc etc.. nothing seems return refresh_token. guess part skipped client or something.

i need know how can refresh_token when user grants access first time can save it.

it not return refresh token designed. tutorial , code mentioned using google apis client library javascript. library uses oauth 2.0 client-side flow making requests require authorization.

as the oauth 2.0 authorization framework says:

oauth 2.0 client-side flow (aka implicit flow) used obtain access tokens (it not support issuance of refresh tokens) , optimized public clients known operate particular redirection uri. these clients typically implemented in browser using scripting language such javascript.

the authorization server must not issue refresh token.

in fact, authorization code flow 1 issue refresh token, , google supports flow in these scenarios: web server applications, installed applications, , applications on limited-input devices, not client-side (javascript) applications or service accounts. get more details here.

so you'll not refresh token in way.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -