Hi Derek,

The simplest thing to do would be to 
use https://developers.google.com/oauthplayground/ to generate a refresh 
token and an access token. The scope to use 
is https://www.googleapis.com/auth/adwords.

Once you get the refresh token, it can be used to obtain an access token 
that expires every hour. Use the access token in the Authorization header 
to make API calls.

If you need the detailed logs, take a look 
at https://developers.google.com/identity/protocols/OAuth2WebServer?hl=en. 
Look at the offline flow that obtains a refresh token.

About urn:ietf:wg:oauth:2.0:oob: You can use that as a redirect URI iff the 
OAuth project type is marked as installed application. So you need to fix 
the project type in the Google Developer console.

I would also 
recommend 
https://github.com/googleads/googleads-dotnet-lib/wiki/How-to-create-OAuth2-client-id-and-secret
 
as a guide. I think the UI is a bit dated, but the flow is unchanged.

Let me know if you need more help.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

P.S: Just wondering, have you tried using AdWords Scripts? Does that work 
for you? https://developers.google.com/adwords/scripts/

On Friday, September 4, 2015 at 2:03:59 PM UTC-4, Derek M wrote:
>
> The last time I worked on AdWords API was about two years ago when 
> ClientLogin was still supported for authorization. I see that no longer is 
> the case now and I must move to using OAuth. I've been having a lot of 
> trouble understanding how to do this.
>
> I'm using server-side Javascript for this and cannot use any client 
> libraries (didn't see any available for AdWords using Javascript anyways). 
> I use Javascript to compose and parse the SOAP requests/responses.
>
> Inside the guide it looks like I should just need to send a POST request 
> to this URL with a few parameters (line breaks for readability):
> https://accounts.google.com/o/oauth2/auth?
> scope=email%20profile&
> redirect_uri=http://localhost&;
> response_type=code&
> client_id=149278968815.apps.googleusercontent.com
>
> However, when I try to do this, I receive a 400 Error saying that "The 
> redirect URI in the request: http://localhost did not match a registered 
> redirect URI."
>
> I have the Redirect URI set within the Developer Console > APIs & auth > 
> Credentials > OAuth client IDs and in there it shows http://localhost for 
> the authorized Redirect URI. The other option I could find in the guide 
> uses some variation of urn:ietf:wg:oauth:2.0:oob , but when I try to set 
> the Redirect URI within this section to that, I am unable to and receive 
> this error "Invalid Redirect: urn:ietf:wg:oauth:2.0:oob must use either 
> http or https as the scheme"
>
> All I'm trying to do from this is get an offline token that does not 
> expire for a while (refresh token I believe is the term) that I can then 
> use within the AdWords API calls I need to make. Can someone help me with 
> figuring out what I'm doing wrong here?
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/9a3ea4f8-c994-4b5b-b0a0-7fbc5fc9dfad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to