Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetRefreshToken.php generating incorrect client_id in URL #16

Closed
Jakobud opened this issue Mar 3, 2014 · 3 comments
Closed

GetRefreshToken.php generating incorrect client_id in URL #16

Jakobud opened this issue Mar 3, 2014 · 3 comments

Comments

@Jakobud
Copy link

Jakobud commented Mar 3, 2014

In the Google API Console, I have created a new Installed Application. The client ID is (obfuscated):

54xxxxxxxxx62-n5238beunu5g6qvbxxxxxxxxxxxxxxxxx.apps.googleusercontent.com

In my auth.ini I have filled out developerToken (approved), userAgent, client_id and client_secret. When I run GetRefreshToken.php I get:

# php GetRefreshToken.php 
Log in to your AdWords account and open the following URL:
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=54xxxxxxxxx62-t9uet6fpdq7c1j0ml93bfksm5ga36ed8.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fadwords.google.com%2Fapi%2Fadwords%2F&access_type=offline

After approving the token enter the authorization code here:

Notice the client_id in the URL is NOT my client ID. The first dozen or so character is correct. But after that its totally different. When I paste in this URL (while logged into my Adwords account) I get this screen:

vcilaxi

At first I assumed maybe the client_id in the URL was some hashed value or something so I didn't think anything of it. But after not being able to figure out a reason for why I was getting this error, my friend suggested changing the URL to my correct client_id. And presto... that worked. I sent me to the page that says:

This app would like to: Manage your AdWords campaigns

I accept this and now it gives me my Refresh Token.

So what is going on here? Is this a bug? Am I misunderstanding something? I could not find the above (wrong) client_id hardcoded anywhere in the PHP library so I'm not sure where it's coming from.

@vtsao
Copy link
Contributor

vtsao commented Mar 3, 2014

Can you double check your auth.ini file again to ensure the client ID matches up and that the example is loading the correct auth.ini file? I am unable to reproduce this. If you can reproduce this issue, please outline the steps and I will look into it.

@Jakobud
Copy link
Author

Jakobud commented Mar 3, 2014

Okay this was an oversight on my part. I thought my project was loading a local version of the library but it was actually loading the library that was installed globally on the server. So all is well there.

However, how do you install this project only local to a project? We have multiple projects on the same server that all need to use different Adwords credentials. But if there is only one auth.ini available via the globally installed library...... How do we deal with this?

@Jakobud Jakobud closed this as completed Mar 3, 2014
@vtsao
Copy link
Contributor

vtsao commented Mar 3, 2014

I think I answered your question here:
https://groups.google.com/forum/#!topic/google-doubleclick-for-publishers-api/EyczFSF8KZg

In the future, please post questions about client library usage on the API forums linked above instead of opening new issues. This helps us better track tickets (using the forums).

Thanks,
Vincent

@vovan47 vovan47 mentioned this issue May 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants