Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service key authentication #83

Open
1 of 4 tasks
mateioprea opened this issue Oct 29, 2019 · 11 comments
Open
1 of 4 tasks

Service key authentication #83

mateioprea opened this issue Oct 29, 2019 · 11 comments
Labels

Comments

@mateioprea
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • question about the decisions made in the repository
  • question about how to use this project

Summary

I'm trying to use this package without asking an user to authenticate using a Web interface. My question here is: does it work with service keys based authentication?

Thanks you!

@avermeil
Copy link
Member

Hi @mateioprea !

At the moment, we don't support Service Accounts. We've actually never used them, so we're not totally sure how they should work. PRs welcome ;)

That said, is there any reason why you wouldn't want to use a standard OAuth flow (just do it once, manually) to get yourself a permanent refresh token? We've set up a helper to do this: https://refresh-token-helper.opteo.com/

@avermeil avermeil added the feature request 💡 New ideas label Oct 29, 2019
@mateioprea
Copy link
Author

Hi @avermeil!

So it works for generating a permanent refresh token?

@npearce
Copy link

npearce commented Feb 4, 2020

I am also looking at the service account option as, from what I can tell (their docs aren't great) Google insists on having a G-Suite domain to create an 'Internal' OAuth consent.

@alessandro-aglietti
Copy link

alessandro-aglietti commented Apr 15, 2020

@avermeil hi!
Thanks for creating this library, we found it very useful.
As @npearce and @mateioprea also asked it is very useful to be able to authenticate with a service account.
In an internal corporate software development context, like us at brumbrum.it, it is useful to associate the credentials with a service account rather than with a real user account.

We're starting to work on this pr, we think to propose somenthing functional in the next days.

Our implementation idea start from adding a ServiceAccount type for the ClientOptions and drill down those data till GrpcClient.
Doing that we will able to extend the accessTokenGetter and manage a new getAccessTokenForServiceAccount in token.ts when ServiceAccount data is set.

Make sense for you?

Regards,

@avermeil
Copy link
Member

Hi @alessandro-aglietti ,

Thanks for taking the time to work on this! Yes, the solution you propose sounds good :)

@mateioprea
Copy link
Author

Hi @alessandro-aglietti,

Quick heads up about the new google ads api: it's so slow that the client that I'm working with decided to switch to adwords api.

Just a quick comparison: for pulling 10k keywords from the AdGroups takes about 30s - 1 minute while with the adwords api, it takes 4-5 seconds. :)

@alessandro-aglietti
Copy link

Hi @alessandro-aglietti,

Quick heads up about the new google ads api: it's so slow that the client that I'm working with decided to switch to adwords api.

Just a quick comparison: for pulling 10k keywords from the AdGroups takes about 30s - 1 minute while with the adwords api, it takes 4-5 seconds. :)

Yeah.. there is also a back to beta statement on https://developers.google.com/google-ads/api/docs/start.
For the moment we only need the offline conversion, we didn't expect to ran in performance problems.

Anyway, thank you for the hint!

@alessandro-aglietti
Copy link

@avermeil here you find our first working version. We've some little fix (naming & docs) to be addressed before opening a PR to this main repo.
In the meantime can you check if our implementation is ok for you?

Btw I've a question about the circle-ci, the project is configured to use dotenv but the yml config didn't create the .env causing failing of the build.
Is ok if we update the circle-ci yml to create a .env from circle-ci envs?

@wcoots
Copy link
Contributor

wcoots commented Mar 3, 2021

At Opteo we don't use this authentication method so we do not currently support it. However we are aware that this is a desired feature so we will be looking into it in the future.

@wcoots wcoots assigned wcoots and unassigned wcoots Mar 4, 2021
@felixmosh
Copy link
Contributor

The work with refreshToken is hard when you don't need user interactions.
refreshTokens do expires.

There is an article regarding using service accounts and google ads with code snippets in some languages,
https://developers.google.com/google-ads/api/docs/oauth/service-accounts

Maybe this can help.

@htdangkhoa
Copy link

Hi @wcoots, I have created a library about Google Ads for NodeJS and support Service Account, you can refer to it: https://github.com/htdangkhoa/google-ads
https://github.com/htdangkhoa/google-ads/blob/main/src/lib/utils.ts#L5

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants