I'll see if I can get enough detail in here. Please hit me with questions 
if I leave something out. I'm trying to move an application from using the 
ClientLogin to OAuth.

No matter what I do, I always get this error back from the service.
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>[AuthenticationError.OAUTH_TOKEN_INVALID @ ; 
trigger:'&lt;null&gt;']</faultstring>
            <detail>
                <ns2:ApiExceptionFault 
xmlns="https://adwords.google.com/api/adwords/cm/v201502"; 
xmlns:ns2="https://adwords.google.com/api/adwords/mcm/v201502";>
                    <message>[AuthenticationError.OAUTH_TOKEN_INVALID @ ; 
trigger:'&lt;null&gt;']</message>
                    
<ApplicationException.Type>ApiException</ApplicationException.Type>
                    <errors 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="AuthenticationError">
                        <fieldPath/>
                        <trigger>&lt;null&gt;</trigger>
                        
<errorString>AuthenticationError.OAUTH_TOKEN_INVALID</errorString>
                        <ApiError.Type>AuthenticationError</ApiError.Type>
                        <reason>OAUTH_TOKEN_INVALID</reason>
                    </errors>
                </ns2:ApiExceptionFault>
            </detail>
        </soap:Fault>

Code wise, all I'm doing is this. Even this I snagged from the example 
code, just because I wanted to see if something in my existing app was 
messing with things.
var user = new AdWordsUser();
AdsOAuthProviderForApplications oAuth2Provider = (user.OAuthProvider as 
AdsOAuthProviderForApplications);
oAuth2Provider.RefreshAccessToken();

ManagedCustomerService managedCustomerService =  
(ManagedCustomerService)user.GetService(AdWordsService.v201502.ManagedCustomerService);
Selector selector = new Selector();
selector.fields = new String[] { "CustomerId", "Name" };
ManagedCustomerPage page = managedCustomerService.get(selector);

Configuration wise, I'm set like this. I know it doesn't make much sense, 
given that I had to blank out so much:
<add key="DeveloperToken" value="xxxxxxxxxxxxxxxxxxxxxx" />
<add key="ClientCustomerId" value="111-111-1111" />
<add key="OAuth2Scope" value="https://www.googleapis.com/auth/adwords"; />
<add key='AuthorizationMethod' value='OAuth2' />
<add key='OAuth2ClientId' 
value='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com'
 
/>
<add key='OAuth2ClientSecret' value='xxxxxxxxxxxxxxxxxxxxxxxx' />
<add key='OAuth2RefreshToken' 
value='1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 
/>
<add key="OAuth2Mode" value="APPLICATION" />

I used the OAuthTokenGenerator to generate the info using the email address 
for the MCC.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ec75b410-a735-4eb8-946f-f9e6c5dc7395%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to