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.

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+!