Oauth2 System is inflexible
benburkhart1 opened this issue · 3 comments
I, like many people, am searching for a decent NPM module to be able to do API interactions with Google Adwords. I already have a refresh token, and my authorized client id is of a Web type, not 'native', and cannot use your library because it expects your specific account setup (which is not documented). Have you looked at how the googleapis client handles authentication? It provides access to the oauth2client directly, so you can adjust to any methodology the developer chooses without forcing them down a path like your library does. If you're open to this sort of thing I don't mind submitting a PR.
The authentication module follows the one documented here (search for urn:ietf:wg:oauth:2.0:oob
). With this model, you log in once by manually navigating to a URL, and then the library re-authenticates you "forever" transparently in the background. This works great in general for server-hosted "deploy and forget" applications. Does this work for you?
I understand, and was able to work with the flow @tomayac, the only Issue I have with it is that it requires an interactive session to be able to fetch the refresh token, which some of us might have done already. The google apis nodejs client provides the ability to work with many different flows, both interactively or non-interactively, was just a suggestion.
The alternative to the existing interactive authentication flow would be to work with Application Default Credentials, which requires more steps. Closing the issue for now.