Getting credentials information

20 views
Skip to first unread message

Dyego Borges

unread,
Nov 3, 2019, 6:55:55 PM11/3/19
to AdWords API and Google Ads API Forum
It is my credential function request
def get_token(request):
    flow
= google_auth_oauthlib.flow.Flow.from_client_secrets_file(
       
'C:\\client_secret.json',
       
scopes=[oauth2.GetAPIScope('adwords')]
   
)
    flow
.redirect_uri = 'https://achedescontos.online/oauth2callback'

    authorization_url, state = flow.authorization_url(
       
access_type='offline',
       
include_granted_scopes='true'
    )

    context
= {
       
'authorization_url': authorization_url
   
}
   
return render(request, 'index.html', context)

It is the response function
def oauth2callback(request):
     context
= {
     
'request': request,
     
'requestget': request.GET,
     
'code': request.GET['code']
     
}
     
return render(request, 'oauth.html', context )





I  am following these steps: https://github.com/googleads/googleads-python-lib/wiki/API-access-on-behalf-of-your-clients-(web-flow)
But I have a question about the STEP 3
flow.fetch_token(code=auth_code)
credentials
= flow.credentials

Where I put this code? I put it in the request function ou response function?

Google Ads API Forum Advisor Prod

unread,
Nov 4, 2019, 12:25:02 PM11/4/19
to dyegobo...@gmail.com, adwor...@googlegroups.com

Hello, 

Thank you for reaching out to support. Since the issue is specific to the Python client library, you could refer to this related issue on the Github. If you're still having an issue, you could post your concerns on the Github Python issue tracker and the library owners will be able to assist you on this. 

Regards,
Bharani, Google Ads API Team



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