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:'<null>']</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:'<null>']</message>
<ApplicationException.Type>ApiException</ApplicationException.Type>
<errors xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:type="AuthenticationError">
<fieldPath/>
<trigger><null></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.