2

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. 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.

Can I use server auth (through node API), get the token, and pass it to user while logging in? 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?

sonia
  • 317
  • 2
  • 15
  • Currently the api Nodejs client API is in Alpa. It will probably be buggy, but you could use that. [Source](https://developers.google.com/analytics/devguides/reporting/core/v3/gdataLibraries) Otherwise you will need to use a different language for your backend. – Wayne Ellery Jan 24 '15 at 23:06
  • Why do I need api? I want need token on server side, for passing to client(s) side... https://developers.google.com/accounts/docs/OAuth2ServiceAccount#makingrequest – sonia Jan 24 '15 at 23:16
  • Sorry, I thought you were wanting to use the api to return data from google analytics and display it. What do you want to do? – Wayne Ellery Jan 24 '15 at 23:22
  • I want do display it in Angular single-page app – sonia Jan 24 '15 at 23:34
  • In which case you would need to use the api on the server to return the data and then display it in your SPA. – Wayne Ellery Jan 24 '15 at 23:38
  • @sonia - Can you tell me how to form **grant_type** and **assertion** to call the rest API – Dipankar Naskar Oct 12 '19 at 05:01

1 Answers1

0

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.

I have now embedApi widget in my Angular.js dashboard for every user, without login.

sonia
  • 317
  • 2
  • 15