<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dannyroa &#187; Python</title>
	<atom:link href="http://www.dannyroa.com/category/python-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dannyroa.com</link>
	<description>tech, music, travel</description>
	<lastBuildDate>Thu, 12 Jan 2012 19:23:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Sign In With Google &amp; Get User Info from Google+ Profile</title>
		<link>http://www.dannyroa.com/2011/09/26/sign-in-with-google-get-user-info-from-google-profile/</link>
		<comments>http://www.dannyroa.com/2011/09/26/sign-in-with-google-get-user-info-from-google-profile/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 00:13:59 +0000</pubDate>
		<dc:creator>dannyr</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.dannyroa.com/?p=260</guid>
		<description><![CDATA[At the start, authentication options for our site Burp (http://goburp.com) include regular email/password &#38; Facebook Connect. For quite a while, I&#8217;ve been wanting to integrate Google Accounts Authentication. I&#8217;ve looked at django-socialauth (http://social.matiasaguirre.net/) but it uses OpenID. I prefer a pure OAuth2 implementation similar to what Facebook &#38; FourSquare uses. Looking at Google&#8217;s documentation, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>At the start, authentication options for our site Burp (<a href="http://goburp.com">http://goburp.com</a>) include regular email/password &amp; Facebook Connect. For quite a while, I&#8217;ve been wanting to integrate Google Accounts Authentication.</p>
<p>I&#8217;ve looked at django-socialauth (<a href="http://social.matiasaguirre.net/">http://social.matiasaguirre.net/</a>) but it uses OpenID. I prefer a pure OAuth2 implementation similar to what Facebook &amp; FourSquare uses.</p>
<p>Looking at Google&#8217;s documentation, it&#8217;s not easy to figure out. The Federated Login (<a href="http://code.google.com/apis/accounts/docs/OpenID.html">http://code.google.com/apis/accounts/docs/OpenID.html</a>) is just a pain to implement. </p>
<p>Google recently streamlined their API &amp; they have libraries for every major programming language. Implementation is too complex though which includes a separate model to store credentials (see <a href="http://code.google.com/p/google-api-python-client/source/browse/oauth2client/django_orm.py">http://code.google.com/p/google-api-python-client/source/browse/oauth2client/django_orm.py</a>).</p>
<p>OAuth2 implementation by FourSquare &amp; Facebook is so simple that there must be a way to do that with Google: Get an authorization url, Get a code back &amp; Exchange that for an access token. Then use that access token to access the API. Google has documentation for OAuth2 but it actually lacks information on how to get a user&#8217;s email address (<a href="http://code.google.com/apis/accounts/docs/OAuth2.html">http://code.google.com/apis/accounts/docs/OAuth2.html</a>).</p>
<p>After scouring the internets, I finally stumbled into a PHP implementation. It has the scope (https://www.googleapis.com/auth/userinfo#email) that I&#8217;ve been looking for which is missing from Google&#8217;s documentation (<a href="http://code.google.com/apis/gdata/faq.html#AuthScopes">http://code.google.com/apis/gdata/faq.html#AuthScopes</a>). The OAuth2 steps are pretty standard except that the access token can be added to the header of the request instead of as a parameter in the url (<a href="http://code.google.com/apis/accounts/docs/OAuth2.html#CallingAnAPI">http://code.google.com/apis/accounts/docs/OAuth2.html#CallingAnAPI</a>).</p>
<p>This, however, only gets me the email address of the user. I also want to get the user&#8217;s name, location, gender, etc.</p>
<p>Luckily, Google just opened up an API for Google+. </p>
<p>By adding the scope &#8211; https://www.googleapis.com/auth/plus.me &#8211; to the OAuth2 call, our app will have access to the public info the user provided in their Google+ Profile. The People:get method (<a href="http://developers.google.com/+/api/latest/people/get">http://developers.google.com/+/api/latest/people/get</a>) will provide you with the user&#8217;s Display Name, Location, and Profile Picture Url among others.</p>
<p>You can view the sample Django project at <a href="https://github.com/dannyroa/sign-in-with-google">https://github.com/dannyroa/sign-in-with-google</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dannyroa.com/2011/09/26/sign-in-with-google-get-user-info-from-google-profile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Site Authentication using Facebook Connect and Google Friend Connect</title>
		<link>http://www.dannyroa.com/2009/03/18/site-authentication-using-facebook-connect-and-google-friend-connect/</link>
		<comments>http://www.dannyroa.com/2009/03/18/site-authentication-using-facebook-connect-and-google-friend-connect/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 05:14:22 +0000</pubDate>
		<dc:creator>dannyr</dc:creator>
				<category><![CDATA[Facebook Connect]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebookconnect]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[googlefriendconnect]]></category>
		<category><![CDATA[opensocial]]></category>

		<guid isPermaLink="false">http://blog.dannyroa.com/?p=75</guid>
		<description><![CDATA[For one of my side projects, I have started using Facebook Connect to authenticate my users. Facebook has done a great job on convincing developers to use their system by providing good documentationt (video, wiki). There are a number of sites that uses FBConnect for authentication such as Citysearch and Techcrunch.

On the other hand, there is Google Friend Connect. You might not know it but it is very similar to Facebook Connect and possibly more powerful with its integration with the OpenSocial libraries.]]></description>
			<content:encoded><![CDATA[<p>For one of my side projects, I have started using Facebook Connect to authenticate my users. Facebook has done a great job of convincing developers to integrate it by providing excellent guides on how to use it (<a href="http://www.facebook.com/video/video.php?v=630563174283">video</a>, <a href="http://wiki.developers.facebook.com/index.php/Facebook_Connect">wiki</a>). There are a number of sites that uses FBConnect for authentication such as Citysearch and Techcrunch.</p>
<p>On the other hand, there is Google Friend Connect. You might not know it but it is very similar to Facebook Connect and possibly more powerful with its integration with the OpenSocial libraries.</p>
<p>So how come we don&#8217;t see sites using it?</p>
<p>Google has not done any significant marketing of Friend Connect as an authentication tool. There are currently less than 30 members on its developer forums (<a href="http://groups.google.com/group/google-friend-connect-developers">link</a>). For those who decide to dip their toes on Friend Connect, Google&#8217;s documentation doesn&#8217;t make it easy for you to figure out how to integrate it in your site. Whereas Facebook makes it prominent in their documentation that authentication is the starting point in using Connect, Google leaves it up to you to figure that out.</p>
<p>Eventually though, I was able to get my app running with Google Friend Connect. It spanned a couple of days (asking questions in the forum and scouring the documentation) versus developing Facebook Connect for my site for just 2-3 hours.</p>
<p>So here is a simple comment app I have created. It gives the user the option to use either Facebook Connect or Google Friend Connect for authentication. I didn&#8217;t encounter any problems having both Javascript libraries in one page. However, I used the Javascript libraries as little as possible and included it only on the login page. I utilized the REST API library of both Connects on the server-side for the rest of the functionalities such as getting the Display Name and Picture Url.</p>
<p>You can access the app at <a href="http://projects.dannyroa.com/connectcomments/">http://projects.dannyroa.com/connectcomments/</a>. Use Firefox or IE. There is a problem displaying the Google Friend Connect button in Chrome. On my next post, I will go in depth with the Google Friend Connect Code and post the source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dannyroa.com/2009/03/18/site-authentication-using-facebook-connect-and-google-friend-connect/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

