I am using Google Analytic Embed API. I want auto authorization so that user don't need to enter credential. But I am not getting how to obtain access_token.
gapi.analytics.auth.authorize({
serverAuth: {
access_token: 'Server side generated token'
}
});
I am using Google Analytic Embed API. I want auto authorization so that user don't need to enter credential. But I am not getting how to obtain access_token.
gapi.analytics.auth.authorize({
serverAuth: {
access_token: 'Server side generated token'
}
});
Share
Improve this question
edited May 11, 2015 at 10:58
mana
6,5476 gold badges52 silver badges71 bronze badges
asked May 11, 2015 at 10:45
JenJen
3981 gold badge4 silver badges15 bronze badges
2
- You cant auto authorize with JavaScript, the user must authenticate themselves. – Linda Lawton - DaImTo Commented May 11, 2015 at 11:04
- @DaImTo authorizing via JavaScript is perfectly fine, as long as you've obtained an access token in a secure way yourself. – Philip Walton Commented May 11, 2015 at 22:24
1 Answer
Reset to default 0To get an access token you're going to have to go through the OAuth 2.0 authorization flow. You can find more details about how OAuth 2.0 works and the steps required here:
https://developers.google./identity/protocols/OAuth2