简体   繁体   English

Angular应用中的Google API服务帐户

[英]Google API service account in Angular app

This sounds like a popular scenario, but I can't find direct answer nowhere... 这听起来像是一个流行的场景,但我无处找不到直接的答案...

I want to plot Analytics data in my app's admin area. 我想在应用程序的管理区域中绘制Analytics(分析)数据。 This area is used by multiple users of the company, and they have to authenticate to access this area. 该区域由公司的多个用户使用,他们必须进行身份验证才能访问该区域。 I plan to use GA service account, but 'browser-key/domain' option seems only available for public api. 我计划使用GA服务帐户,但“浏览器密钥/域”选项似乎仅适用于公共api。

Can I use server auth (through node API), get the token, and pass it to user while logging in? 我可以在登录时使用服务器身份验证(通过节点API),获取令牌并将其传递给用户吗? Will the token be valid? 令牌有效吗? Can I have multiple valid tokens simultaneously for all the users? 我可以同时为所有用户拥有多个有效令牌吗?

Or maybe there is some other way to do it? 也许还有其他方法可以做到?

Okay, I've tested it myself and the answer is: 好的,我已经亲自测试过了,答案是:

YES, you get universal (max 60min) token with every request - so you can have many of them, and dispose to you client-side apps as needed. 是的,您每次请求都会获得通用(最长60分钟)令牌-因此您可以拥有很多令牌,并根据需要将其分配给客户端应用。

I have now embedApi widget in my Angular.js dashboard for every user, without login. 现在,我在Angular.js仪表板中为每个用户提供了embedApi小部件,无需登录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM