admin管理员组文章数量:1023758
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
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
本文标签: javascriptHow to obtain accesstoken for google analyticsStack Overflow
版权声明:本文标题:javascript - How to obtain access_token for google analytics? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745519841a2154264.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论