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.comHowever, 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?