oauth2-extensions icon indicating copy to clipboard operation
oauth2-extensions copied to clipboard

Setting in Cloud Console to make things work?

Open imrehg opened this issue 11 years ago • 1 comments

Hi,

I was wondering what other settings I have to take care of besides the steps mentioned in the Readme/blog and in the source code, that the OAuth 2.0 authentication will work correctly?

At the moment if I implement the client login in my Chrome extension following the simple samples, I keep getting Error: redirect_uri_mismatch messages.

I have set up a new project in the Google Cloud Console, registered a new app with "Chrome" type (with the extension ID from the Web Store), and got a client ID and client secret. No Redirect URI setting is shown me in the interface, and if I download the settings JSON, I see the following (as part of the total settings)

"redirect_uris":["urn:ietf:wg:oauth:2.0:oob","oob"]

If I set either of these as the return value of the redirectURL function in oauth2/adaptors/google.js I successfully get an access token - but the copy-paste type, which is not the intended outcome using this library.

I wonder how the sample code are set up from the Cloud Console point of view if that's used, that it can successfully redirect to https://www.google.com/robots.txt?

Any pointers, what am I missing?

imrehg avatar Nov 24 '13 15:11 imrehg

I'm also having issues with this, my browser gives me this message:

Error: redirect_uri_mismatch Request Details cookie_policy_enforce=false scope=https://www.googleapis.com/auth/drive response_type=code redirect_uri=http://www.google.com/robots.txt access_type=offline display=page prompt=consent client_id=****_redacted_****googleusercontent.com

I set my redirect uri to localhost:9004 like it says

here:https://developers.google.com/accounts/docs/OAuth2InstalledApp?hl=de

and it opened up a new tab containing my code in the address bar. Will post back with more info.

aclave1 avatar Dec 23 '13 06:12 aclave1