Cannot connect to Youtube Data API V3 with javascript - javascript

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?

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.

Related

Can I use Google Auth 2.0 from any origin?

I develop modal window with React.js, that can be distributed for several sites via some kind of web application market.
So I faced the issue, that for any website, that would install this extension (btw it's builded to a simple html page + couple of js files, so app will be hosted directly on website of even customer), Google auth error will throw exception of invalid origin.
So is there any way to find a workaround for my case?
btw now I'm using react-google-login library
Google allows you to set multiple URIs. Just take a look in the settings.

Firebase Javascript network error

I have a Firebase app and have started playing around with the quickstart examples. I have created apps in Facebook, Google and Twitter and filled in the necessary clientId/secret information.
When testing the example pages facebook-credentials.html and google-credentials.html, everything works fine.
I am using Firebase 3.6.4 JS also.
When trying out the facebook-popup.html and facebook-redirect.html, and in fact the popup/redirect examples for Google and Twitter, I always get the following error in the Javascript console:
firebase.js:191 Uncaught Error: Network Error
at firebase.js:191
(anonymous) # firebase.js:191
This seems to happen fairly quickly, but the HTTP request is still pending. After maybe 30 seconds, I then get another message in the console:
GET https://XXXXXXX.firebaseapp.com/__/auth/iframe?apiKey=YYYYYYY&appName=%5BDEFAULT%5D&v=3.6.4&usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.1grkUO4uZ2s.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCMXwBvX3_duAb3Vw22ujByEbXKdJA net::ERR_TIMED_OUT
(note I have masked out my application name as XXXXXXX and API key as YYYYYYY).
Does anyone know why this is happening?
I really want to get Twitter working, but there is no twitter-credentials method, so I'll need to get the popup or redirect working.
It appears that this was a lower level issue on my PC. I haven't gotten to the bottom of it yet but the Twitter examples work on another PC. At this point I am thinking it might be my antivirus or Firewall, so I am closing this topic.
I think you're also being blocked. My application quit working, and another one that was using firebase also quit working, so we called IT. There was new security software blocking the network request. Similar errors, blank popup, that's how I ended up here.

How to get Google Drive API example to run in Phonegap application (support for Android)?

I have successfully been able to use the example provided for the Google Drive API to authenticate and get files & folders of a user's Drive (https://developers.google.com/drive/web/quickstart/quickstart-js).
But I need to convert this example to be able to launch on an Android device using Phonegap. When I run the Phonegap application I get the following error:
Refused to display document because display forbidden by X-Frame-Options.
I have had a look at some answers for dealing with this error for other applications such as including SAMEORIGIN for X-Frame-Options in the meta tag and running the application in the emulator to see if it works but it does not. I have also made sure that the inAppBrowser plugin has been added.
Note, I am using localhost to test the application. I'm not sure if this will cause an issue.
I'm not sure how to solve Google Drive authentication in a Phonegap application.
I'm not sure what your issue is at this point, nor what you are ultimately wanting to do with your app. Consider looking at Filepicker.io as a PhoneGap integration point for Google Drive. Filepicker.io Home Page and the github repo for the plugin

Post mini-status update to user's wall

I've successfully implemented Facebook Connect (using Javascript SDK) on my site and now would like to have a message appear on the user's wall showing they have started using application X.
For example RockMelt shows such a thing as in the below picture:
Is this a simple permission I need to request for? I've tried public_stream but doesn't seem to do anything.
these are auto-generated by facebook for fb apps that have the social-discovery option enabled. u can find that settings in your dev app.

Simple application to aggregate information from multiple web services in fullscreen

Whats the easiest way to build a simple 'web' application which is a single page, that just refreshes itself (using AJAX or something) to display continuously changing data hosted on various different servers on the internet?
I want to interface with (for example) Twitter, Facebook, Skype, Google Calendar, and any number of other services that have some type of web API.
The application does not need to allow user interaction other than to configure it with the authentication parameters needed to access those services.
It should be able to run full-screen with no UI elements showing, just the pretty information I am displaying.
I started to write an HTML file using Jquery but I am running into "Same Origin Policy" issues. Is there a way around this?
I'd love to just write this in Html/Javascript and run it in Google Chrome, is that possible somehow? I don't know how to get around SOP without hosting my own web server as a proxy to cross the domains.
Is there another alternative that is still pretty easy and simple? I looked into using the Windows Vista Sidebar but apparently you can't have a full-screen gadget.
I figured out that I can use the command line option for chrome:
--disable-web-security
And it will allow me to workaround the same origin policy, and since I am using this for a local application I can put the app in a virtual machine and let it run without too much worry.

Categories

Resources