Authentication without user interaction (NODE.JS)

381 views
Skip to first unread message

Che Siri

unread,
May 31, 2017, 6:32:15 AM5/31/17
to AdWords API Forum
Hello, I am new to adwords api and I am not understanding very well the authorization process.
I am developing a console app on Node.js.
I want to know if there is a way to authenticate without the need of the approval of the user in the web of consent. I understand that this returns the "code" to then generate the credentials with the refresh_token.
I need these credentials for the node module I am using but also
I need a login without the interaction of the user or the browser.

Example of implementation:
Let user = new AdwordsUser ({
        DeveloperToken: DEVELOPER_TOKEN2, // your adwords developerToken
        UserAgent: 'Siri inc', // any company name
        ClientCustomerId: CLIENT_CUSTOMER_ID2, // the Adwords Account id (e.g. 123-123-123)
        Client_id: CLIENT_ID2, // this is the api console client_id
        Client_secret: CLIENT_SECRET2,
        Refresh_token: tokens.refresh_token, // <=== Here's the problem
        Access_token: tokens.access_token // <=== Here is the problem
        });


Thank you!

Shwetha Vastrad (AdWords API Team)

unread,
May 31, 2017, 10:20:26 AM5/31/17
to AdWords API Forum
Hi, 

All AdWords API calls must be authorized through OAuth2. You could consider using service accounts to access AdWords API. Service accounts employ an OAuth2 flow that doesn't require human authorization, but uses instead a key file that only your app can access. Please follow this guide to set up service account access. Because of the complexity of setting up service account access for AdWords API, it is recommended that you use installed app or web flows instead of service accounts unless you need domain-specific features (for example, impersonation). OAuth2 installed application and web flows require user interaction only once, when access to the account is granted.

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages