Is there a way were user promt is skipped?

6 views
Skip to first unread message

Kalpit Patel

unread,
Jul 20, 2018, 5:54:17 AM7/20/18
to AdWords API and Google Ads API Forum
I do not want user's consent , my motive is to daily update reports for a campaign for that i need to every time get user consent for the access code.

auth_client = client_secrets.to_authorization
auth_client.update!(
:scope => 'https://www.googleapis.com/auth/adwords',
:redirect_uri => 'http://localhost:3000/oauth2callback',
"access_type" => "offline",
"include_granted_scopes" => "true"
)
auth_uri = auth_client.authorization_uri.to_s
auth_client.code = "AUTHCODE"
res = auth_client.fetch_access_token!
raise res.inspect

Dhanya Sundararaju (AdWords API Team)

unread,
Jul 20, 2018, 3:49:50 PM7/20/18
to AdWords API and Google Ads API Forum
Hi Kalpit,

You can store the user's token and their id in your database so that you can retrieve it the next time they log in to your system. That way, they do not have to re-grant authorization every time. Please refer to this section of the guide for better clarity. Also, Offline access section of this guide may be handy setting up OAuth. Please let me know if you have any further questions.

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