1

So I'm building a Phonegap app and I need to access Youtube's Data API. I managed to access the simple API (The one that requires an API key) yet I'm having trouble connecting with OAuth.

I did everything the walkthrough guides told me to do, I have generated a Client ID for Web application from https://console.developers.google.com.

I'm using the auth.js file from their example at the google developers website

The main issue is that every time I try to log in, I get this error:

Refused to display 'https://accounts.google.com/o/oauth2/auth?client_id=' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

I tried clearing my cookies but to no avail. I run this on localhost with Visual Studio, maybe this has something to do with that?

3
  • Have you reviewed this answer as it seems related? Commented Oct 27, 2015 at 15:41
  • Hi camelCase, I was actually there before writing this post. They talk about adding &output=embed" to the URL. I'm not sure to which url I should append this to. Commented Oct 27, 2015 at 15:44
  • Append it to the url that you are trying to access on YouTube which is giving you the error. Commented Oct 27, 2015 at 15:49

1 Answer 1

1

Ok, so after spending some time on it I finally figured out what the problem was.

On https://console.developers.google.com when I created my OAuth 2.0 client ID there was the "Authorized JavaScript origins" field which I left blank. Since I was running it from my localhost, I added http://localhost:28299 to the list of safe origins and everything worked fine.

Of course this is just for the development phase.

Sign up to request clarification or add additional context in comments.

2 Comments

Glad you got it sorted
Thanks! appreciate the help

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.