Wednesday, February 15, 2012

We had a great question about using OAuth2 in a hangout.

As we are still in Developer Preview, we're still working out the final details of our authentication system.  Right now, you can use the Google JS API client (google-api-javascript-client) to get an OAuth2 token.

I've added some sample code in a Hangout Experiments project on Google Code, as this is still something to experiment with (and, indeed, the js client is also still in alpha).  However, if you need to "do the oauth dance" in a Hangout, feel free to give this a spin.

http://code.google.com/p/hangout-experiments/

I've included two versions.  One for running in an iframe on your site (as mentioned in this blog previously), and one uses the standard gadget spec

In the iframe version, you must specify your client ID and API key. 

In the gadget version, the gadget server will take care of that for you, but you still need to go to the "API Access" tab in the developer console to create a client ID and API key.

Good luck!  Post questions here or on Google+!

2 comments:

  1. Is this supported in IE? The gadget version works but when I try the iframe version, the app fails to load and the console prints "SEC7111: HTTPS security is compromised." I tried this in IE9.

    ReplyDelete
  2. That message is often caused by mixed-content, so you're loading http vs. https. Would that apply here?

    ReplyDelete