0

I'm trying to run the Google Javascript YouTube API samples, and I get the following error when the page (search.html) loads:

Refused to display 'https://accounts.google.com/o/oauth2/auth?client_id=[XXX]...F%2Flocalhost&response_type=token&state=366536542%7C0.931065623&authuser=0' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

I'm running this from a host that's authorized in the "JavaScript origins" section of my credentials in Google Developer Console.

The only change I've made to the code was to enter my credentials in auth.js

Any ideas?

1 Answer 1

1

Be sure to put your Client ID in auth.js.

var OAUTH2_CLIENT_ID = 'XXXXX.apps.googleusercontent.com';

Plus, to configure Redirect URIs and JavaScript origins in https://console.developers.google.com for localhost :

Client ID   XXXXXX.apps.googleusercontent.com

Email address   [email protected]

Client secret       XXXX

Redirect URIs   http://localhost/oauth2callback

JavaScript origins  http://localhost
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.