How to authenticate user only once | Google Ads v7

33 views
Skip to first unread message

Suchitra Theruvath

unread,
Jul 12, 2021, 8:23:05 AM7/12/21
to AdWords API and Google Ads API Forum
Hi,

I am trying to build a Java web application based on user authentication. I have used the below code.

UserAuthorizer userAuthorizer = UserAuthorizer.newBuilder()
          .setClientId(
              ClientId.of(clientId, clientSecretKey))
          .setScopes(Arrays.asList(scope)).setTokenStore(new MemoryTokensStorage())
          //.setAccessType("offline")
          .setCallbackUri(URI.create(callbackUrl)).build();

But the user is asked to authenticate every time this logic is called. I assume, setting the access type to "offline" would not ask the user to login every time, until the access token is expired. But I am unable to find such an attribute in this. Please let me know how this can be resolved.

Regards,
Suchitra

Google Ads API Forum Advisor

unread,
Jul 13, 2021, 3:13:59 AM7/13/21
to adwor...@googlegroups.com

Hi Suchitra,

Thanks for reaching out to the Google Ads API Support.

Could you confirm if you are indeed following the web app authentication flow? Whether you are using this flow or the desktop app flow, the client library you are using should already automatically take care of the authentication on your behalf.

That being said, are you currently encountering issues or errors, with authentication? If yes, could you provide the complete request and response logs, with the request-id?

If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,
 

Google Logo
Yasar
Google Ads API Team
 


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