Hi,
thanks for your help. Now it works for me, but not with service accounts ;-)
Am Dienstag, 26. November 2013 05:10:04 UTC+1 schrieb Takeshi Hagikura
(AdWords API Team):
>
> Hi,
>
> The documentation looks not right.
> There is no concept of access type for service accounts.
> We're fixing the sample code. For the time being please ignore the line of
> ".setAccessType("offline")".
>
> The error messages seems you don't have a proper access token.
> When you invoked the .refreshToken() method, do you have an access token
> set to the GoogleCredential instance?
>
> Best,
> - Takeshi, AdWords API Team
>
> On Thursday, November 21, 2013 4:56:26 PM UTC+9, GrueneOrchidee wrote:
>>
>>
>> Hi Takeshi,
>>
>> thanks for your answer. I already answered more than a week ago but this
>> answer is not visible, so I try it again.
>>
>> I tried using your guide but the method setAccessType("offline") is not
>> available at class GoogleCredential of v201309 or v201306. Without this
>> method call, I get the following exception:
>>
>> <soap:Header>
>> <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201306
>> ">
>> <requestId>0004ebab35eb23200ae56889000002cb</requestId>
>> <serviceName>AdGroupService</serviceName>
>> <methodName>get</methodName>
>> <operations>0</operations>
>> <responseTime>91</responseTime>
>> </ResponseHeader>
>> </soap:Header>
>> <soap:Body>
>> <soap:Fault>
>> <faultcode>soap:Server</faultcode>
>> <faultstring>[AuthenticationError.OAUTH_TOKEN_INVALID @ ;
>> trigger:'<null>']</faultstring>
>> <detail>
>> <ApiExceptionFault xmlns="
>> https://adwords.google.com/api/adwords/cm/v201306">
>> <message>[AuthenticationError.OAUTH_TOKEN_INVALID @ ;
>> trigger:'<null>']</message>
>> <ApplicationException.Type>ApiException</ApplicationException.Type>
>> <errors
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance<http://www.google.com/url?q=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance&sa=D&sntz=1&usg=AFQjCNFERp6A_kcvqihMCKJ7EHX8O14vIA>"
>>
>> xsi:type="AuthenticationError">
>> <fieldPath/>
>> <trigger><null></trigger>
>> <errorString>AuthenticationError.OAUTH_TOKEN_INVALID</errorString>
>> <ApiError.Type>AuthenticationError</ApiError.Type>
>> <reason>OAUTH_TOKEN_INVALID</reason>
>> </errors>
>> </ApiExceptionFault>
>> </detail>
>> </soap:Fault>
>> </soap:Body>
>> </soap:Envelope>
>>
>>
>>
>> Am Mittwoch, 6. November 2013 10:30:43 UTC+1 schrieb Takeshi Hagikura
>> (AdWords API Team):
>>>
>>> Hi,
>>>
>>> You can use OAuth2 service account as in this
>>> guide<https://developers.google.com/adwords/api/docs/guides/service-accounts>
>>> .
>>> But if you don't use a service account specific feature (i.e.
>>> impersonation), I recommend using other authentication type, if you use app
>>> engine, web flow can be used.
>>>
>>> Even if you use other authentication types (installed application or web
>>> flow), user interaction is required only once.
>>>
>>> Best,
>>> - Takeshi, AdWords API Team
>>>
>>> On Wednesday, October 30, 2013 11:26:19 PM UTC+9, GrueneOrchidee wrote:
>>>>
>>>> I want to change the login from ClientLogin to OAuth2.0. I read so many
>>>> tutorials about OAuth2.0 but it doesn't work.
>>>>
>>>> I want a login mechanism without user interaction and without the use
>>>> of a browser, so I decided to use Service Account. Therefore I created at
>>>> Google Console an OAuth 2.0 Client ID by selecting 'service account'. The
>>>> result was the file with the private key. Afterwards I tried to create a
>>>> JWT and sign it with the private key. But I couldn't find a Java class at
>>>> AdWords library (adwords-appengine) that can do this. Which class do I
>>>> have
>>>> to use?
>>>>
>>>>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.