The web application that we are building would need the user to 
authenticate himself over Google Ads, so that only the accounts accessible 
for him will be fetched and processed. Hence when the user hits the 
application url, the oauth page comes, where he logs in and allows access 
for our application. This will be a one time activity and then every time 
the user accesses the application url, since the auth token is already 
available in the request params, the user will not be asked to authenticate 
again, instead he will be automatically redirected to the main page of our 
application. We were able to enable this feature in our previous project, 
where we had used Adwords API, but using Google Ads API, we are unable to 
fix this issue.
This is the code that we are having : 
*UserAuthorizer userAuthorizer = UserAuthorizer.newBuilder()*
*              .setClientId(*
*                  ClientId.of(adwordsProperties.getClientId(), 
adwordsProperties.getClientSecret()))*
*              .setScopes(Arrays.asList(adwordsProperties.getScope()))*
*              .setTokenStore(new MemoryTokensStorage())*
*              .setCallbackUri(URI.create(callbackUrl)).build();*
We have chosen the web app flow and here is the request URL been created : 
*https://accounts.google.com/o/oauth2/auth?response_type=code&client_id= 
<https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=>xxx&redirect_uri=http://localhost:8081/oauth2callback&scope=https://www.googleapis.com/auth/adwords&state=
 
<http://localhost:8081/oauth2callback&scope=https://www.googleapis.com/auth/adwords&state=>*
*xxx**&access_type=offline&approval_prompt=force&login_hint=x...@google.com 
<stheruv...@google.com>&include_granted_scopes=true*

In our previous application using Adwords API, we had implemented the same 
flow and there was no oAuth request created for every hit.
*https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=xxx&redirect_uri=http://localhost:8080/oauth2callback&response_type=code&scope=https://www.googleapis.com/auth/adwords
 
<https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=xxx&redirect_uri=http://localhost:8080/oauth2callback&response_type=code&scope=https://www.googleapis.com/auth/adwords>*
We are trying to find out what it is that we are missing in our 
authentication process, due to which the user is prompted to go through 
oauth every time the application url is accessed.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/4c7a3528-3451-4c28-b231-5741da4e5015n%40googlegroups.com.
  • How to authen... 'Kaushik Komanduri' via AdWords API and Google Ads API Forum

Reply via email to