oauth2 readonly scope in nodeJS

42 views
Skip to first unread message

Rc B

unread,
Jun 8, 2020, 5:34:50 AM6/8/20
to AdWords API and Google Ads API Forum
hi 
i use nodeJs to communicate with adwords account via the api. 
it works perfectly but when launching an oauth popup to the user, it asks for permissions to "manage adwords accout"
in my case, I only require "READ" permissions from the user due to the nature of my service which is only to provide metrics  for each campaign. 

my code is as follow: 
const {OAuth2Client} = require('google-auth-library');

generateAuthenticationUrl() {
        return this.oauth2Client.generateAuthUrl({
            access_type: 'offline',
            prompt: 'consent',
            scope: 'https://www.googleapis.com/auth/adwords'
        });
    }

after a glimpse in the reference, I've tried to add ".readonly" suffix but it didn't work.
(scope: 'https://www.googleapis.com/auth/adwords.readonly')

is it doable? can I define a READ-ONLY scope? if so, how do I achieve that?

Thanks, Roby (-: 

Google Ads API Forum Advisor Prod

unread,
Jun 8, 2020, 1:41:09 PM6/8/20
to rcbu...@gmail.com, adwor...@googlegroups.com
Hi Roby,

Thank you for reaching out. Unfortunately, NodeJs isn't a supported client library so I am unable to help with the specifics of that library. On a more general level, if you are just using the API for reporting, you can change your Permissible Use to "Reporting" which will limit your developer token to just reporting features.

Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q20X0Rq:ref
Reply all
Reply to author
Forward
0 new messages