<?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>CS and the City &#187; Google</title>
	<atom:link href="http://sean.lyn.ch/category/business/goog/feed/" rel="self" type="application/rss+xml" />
	<link>http://sean.lyn.ch</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 08:16:31 +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>Android, the Facebook SDK, SSO, and You</title>
		<link>http://sean.lyn.ch/2011/07/android-the-facebook-sdk-sso-and-you/</link>
		<comments>http://sean.lyn.ch/2011/07/android-the-facebook-sdk-sso-and-you/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 08:59:52 +0000</pubDate>
		<dc:creator>Sean Lynch</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://sean.lyn.ch/?p=136</guid>
		<description><![CDATA[There seems to be near universal misunderstanding of Facebook&#8217;s Android SDK and the single sign on (SSO) feature Facebook added late last year. I originally wrote a response on Stack Overflow detailing the fix but I didn&#8217;t realize the connection to SSO at the time. I&#8217;m hoping this post can summarize the problem and solutions [...]]]></description>
			<content:encoded><![CDATA[<p>There seems to be near universal misunderstanding of Facebook&#8217;s Android SDK and the single sign on (SSO) feature <a href="https://www.facebook.com/blog.php?post=446167297130">Facebook added late last year</a>.  I originally wrote a <a href="http://stackoverflow.com/questions/4848067/login-failed-invalid-key-error-with-facebook-sdk/6528363#6528363">response on Stack Overflow</a> detailing the fix but I didn&#8217;t realize the connection to SSO at the time. I&#8217;m hoping this post can summarize the problem and solutions for the mass of similarly confused developers who get stuck here.</p>
<h3>Background</h3>
<p>In November 2010, Facebook announced that they&#8217;re enabling Single Sign On in the Android SDK. Applications that take advantage of this feature will allow users to skip re-entering credentials and dive right into the action. What they do not mention is that SSO isn&#8217;t a feature developers opt into, it&#8217;s actually on by default. However, it only changes the way the Facebook SDK works <strong>IF</strong> the Facebook application is also installed. This causes the problem that most developers (including myself) see when they first set out to build an application.</p>
<h3>The issue</h3>
<p>The typical description of the problem goes something like this: You&#8217;ve downloaded the SDK and your application is running perfectly with shiny new Facebook authentication on the Android emulator. But when you deploy it to a device, it no longer works. The app loads but the Facebook login dialog disappears instantly. If you&#8217;re more familiar with Android development than I was at the start, you start up your copy of <tt>adb logcat</tt> while your application is running and you see logs that look something like this:</p>
<p><code>D/Facebook-authorize( 2194): Login failed: invalid_key<br />
W/System.err( 2194): com.facebook.android.FacebookError: invalid_key</code></p>
<p>At this point, you Google for solutions to the issue and quickly start pulling out your hair out at the number of people reporting this issue with no apparent fix. The problem is actually very simple, though not immediately obvious. The problem is that, when deploying your application to the device after developing on the emulator, you&#8217;ve inadvertently and implicitly enabled Single Sign On because your device has the Facebook application installed.  This is why one of the reported fixes is to uninstall the Facebook application. Your emulator does not have the Facebook application installed (though the Facebook SDK includes it if you want to install it), but your device does, thus triggering the SSO code.  And SSO has some special configuration requirements that non-SSO does not which causes the invalid_key error above.</p>
<h3>Fixing the Issue</h3>
<p>There are a few different ways to tackle this problem.</p>
<p><strong>1. The ugly: Uninstall the Facebook app</strong></p>
<p>Don&#8217;t do this. You&#8217;re not going to be able to ask your users to do the same anyway. The only reason this works is because the SSO functionality is triggered by the presence of the Facebook application and this simply removes the possibility of using SSO completely, which is also a crappy user experience.</p>
<p><strong>2. The bad: Opt-out of Single Sign On</strong></p>
<p>If you want, you can actually have your application skip SSO completely. You probably don&#8217;t want to do this, but it&#8217;s a reasonable solution if you&#8217;re convinced you do. To do so, you need to modify the code calling Facebook to specify that you want to handle auth on your own.  You do this by passing <tt>FORCE_DIALOG_AUTH</tt> value into the <tt>authorize</tt> method&#8217;s <tt>activityCode</tt> parameter.</p>
<p><strong>3. The good: Set up Single Sign On properly (recommended)</strong></p>
<p>Unless you have a good reason not to, you should set up SSO. It&#8217;s a bit more work, but it&#8217;s the best experience for your users.  </p>
<p>Buried in the Facebook documentation is a mention about hash codes. Although it&#8217;s not obvious in the documentation, Single Sign On requires applications to provide a Key Hash or certificate (I use them interchangeably) of the signature used to sign the application to Facebook. This is used as part of the validation with SSO.  When applications are built by the Android development tools, they&#8217;re automatically signed using a debug keystore. You need to use this keystore to generate the certificate. Details about the Debug keystore are available in the <a href="http://developer.android.com/guide/publishing/app-signing.html#debugmode">Android Documentation &#8211; Signing Applications</a>.</p>
<p>In order to provide Facebook with information about the signature, you need to pull it from the keystore. On OSX, you do this in the terminal with the following command:</p>
<p><code>keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64</code></p>
<p>This generates a short string of characters (which may include characters such as &#8216;=&#8217; or &#8216;/&#8217;) that identify the signature. This is the certificate or Key Hash as Facebook calls it. Once you have this, you need to give it to Facebook.</p>
<p>Find your application on <a href="https://developers.facebook.com/apps">Facebook&#8217;s Developer page</a> (or create a new one if you haven&#8217;t set one up already). Once you&#8217;re in the application summary page, choose &#8216;Edit&#8217; on the Settings banner and then pick &#8216;Mobile&#8217; on the left-hand side. Under the Android section, you&#8217;ll see a box for Key Hash. Paste the certificate string from the command above into this box and hit save. Give it a few minutes to propagate and try running your application again. The invalid_key errors should disappear.  Keep in mind, when you sign your application for distribution, you&#8217;ll have to generate another certificate like you do here and provide that as well.</p>
<h3>SSO Weirdities</h3>
<p>SSO isn&#8217;t completely smooth sailing though, there are a few issues to watch out for.</p>
<p><strong>1. authorize() always shows a page, even if the user is authorized</strong><br />
As far as I&#8217;m concerned, this is a bug in the SDK. The workaround is to store the token after authorizing the first time and simply use that instead of calling authorize again while <tt>isSessionValid()</tt> is true (Stack Overflow has a great example of <a href="http://stackoverflow.com/questions/4495845/how-to-avoid-already-authorized-in-android-facebook-sdk">how to save the access_token using Android&#8217;s PreferenceManager</a>). However, unless you want to request an offline_access token, the token will only be valid every 24 hours. </p>
<p><strong>2. Different Access Token formats</strong><br />
The token received from SSO applications are of a different format. There&#8217;s a <a href="http://bugs.developers.facebook.net/show_bug.cgi?id=14037">bug open on Facebook&#8217;s bug tracker</a> about this, but they can&#8217;t seem to track it down despite it being easy to replicate.  This isn&#8217;t a huge issue, but unfortunately, you won&#8217;t be able to parse the user ID of the Facebook User out of the SSO token the way you can from standard access token format</p>
<p><strong>3. UI is inconsistent between SSO and non-SSO</strong><br />
Non-SSO uses a nicer pop-over dialog to show the authentication panel while the SSO panel slides in from the right (and back out to the right after the user finishes). There doesn&#8217;t appear to be a way to change this UI, at least without hacking the SDK code directly.</p>
]]></content:encoded>
			<wfw:commentRss>http://sean.lyn.ch/2011/07/android-the-facebook-sdk-sso-and-you/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Playing with PubSubHubBub</title>
		<link>http://sean.lyn.ch/2009/07/playing-with-pubsubhubbub/</link>
		<comments>http://sean.lyn.ch/2009/07/playing-with-pubsubhubbub/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 02:01:24 +0000</pubDate>
		<dc:creator>Sean Lynch</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Protocols]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[pubsub]]></category>
		<category><![CDATA[pubsubhubbub]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[sup]]></category>

		<guid isPermaLink="false">http://sean.lyn.ch/?p=107</guid>
		<description><![CDATA[This week I&#8217;ve been taking a look at the recently announced pubsubhubbub by Brad Fitzpatrick and Brett Slatkin of Google. The duo proposed and implemented a protocol for implementing near-realtime notifications on top of RSS and Atom. The protocol describes three roles: A publisher, a subscriber, and a hub. The hub basically acts as an [...]]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;ve been taking a look at the recently announced <a href="http://code.google.com/p/pubsubhubbub/">pubsubhubbub</a> by Brad Fitzpatrick and Brett Slatkin of Google.  The duo proposed and implemented a protocol for implementing near-realtime notifications on top of RSS and Atom.  The protocol describes three roles: A publisher, a subscriber, and a hub.  The hub basically acts as an intermediary, receiving subscription requests from subscribers and forwarding update notifications from publishers to subscribers.</p>
<p>One of the first things I noticed about the protocol is that subscribers are required to have an internet accessible URL for validating subscription registration and receiving notification pings.  This is not an issue for the Google Readers and FriendFeeds of the world, but this does leave desktop RSS readers out of the party. </p>
<p>Also interesting to note is that there&#8217;s nothing that requires the hub to be a separate entity from the publisher.  In fact, it could be very desirable for the publish to own the subscription hub. Besides removing one notification roundtrip from the protocol, it would also give publishers more control over how often to ping users on updates.  Nothing in the protocol requires that a notification be sent every time, so it would be possible to only notify a subset of users in real time (perhaps the ones that pay), and others on a regular basis. </p>
<p>Depending on how deep your RSS Trivia knowledge goes, this might sound awfully close to the <a href="http://cyber.law.harvard.edu/rss/soapMeetsRss.html#rsscloudInterface">rssCloud element</a>, but Brett points out that the key differentiator here is PSHB&#8217;s &#8220;<a href="http://code.google.com/p/pubsubhubbub/wiki/PriorArt">fat pings</a>&#8220;, that is, the entire updated content is sent as the ping to the user. </p>
<p>To reduce latency and polling, PSHB supports persistent HTTP connections from hubs to publishers, but it could use FriendFeed&#8217;s <a href="http://blog.friendfeed.com/2008/08/simple-update-protocol-fetch-updates.html">SUP</a> protocol to detect updates as well.  </p>
<p>Though solving slightly different problems, it&#8217;s interesting to compare the SUP&#8217;s and PSHB&#8217;s stance on polling.  SUP obviously relies heavily on polling, despite drastically reducing the amount required. While PSHB has strong <a href="http://code.google.com/p/pubsubhubbub/wiki/WhyPollingSucks">opinions against</a>.  Polling is certainly less error prone, in addition to being less efficient.  For example, how does PSHB handle dropped pings to subscribers?  I admittedly haven&#8217;t dug too deep, but I assume a reasonable amount of state must be maintained in the hub to handle these cases smoothly.</p>
<p>Ultimately the most valuable contribution of the entire project might be the two outspoken Google employees behind it.  Already they are seeing some adoption. The <a href="http://www.youtube.com/watch?v=ewQBgbysSOQ">pubsubhubbub demo at Real-Time CrunchUp</a> announced launched FeedBurner support and showed prototypes of Blogger and Reader support.  Having evangelists inside the company puts early adoption in other Google products much more likely, which in turn will give the standard much more credibility. </p>
]]></content:encoded>
			<wfw:commentRss>http://sean.lyn.ch/2009/07/playing-with-pubsubhubbub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Apps Premiers</title>
		<link>http://sean.lyn.ch/2007/02/google-apps-premiers/</link>
		<comments>http://sean.lyn.ch/2007/02/google-apps-premiers/#comments</comments>
		<pubDate>Fri, 23 Feb 2007 08:43:15 +0000</pubDate>
		<dc:creator>Sean Lynch</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Apps]]></category>
		<category><![CDATA[SaaS]]></category>

		<guid isPermaLink="false">http://seanlynch.wordpress.com/2007/02/23/google-apps-premiers/</guid>
		<description><![CDATA[Google announced today the roll out of the enterprise version of their Google Apps package: Google Apps Premier Edition. Download Squad and SaaS Blog have pretty good round-ups on the reaction across the net, and the reaction has been wide spread. Google&#8217;s not the first to tackle this problem. ThinkFree and Zoho already have mature [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://googleblog.blogspot.com/2007/02/google-apps-grows-up.html">Google announced today</a> the roll out of the enterprise version of their Google Apps package: Google Apps Premier Edition. <a href="http://www.downloadsquad.com/2007/02/22/reaction-to-google-apps-premier-edition/">Download Squad</a> and <a href="http://www.saasblogs.com/">SaaS Blog</a> have pretty good round-ups on the reaction across the net, and the reaction has been wide spread.</p>
<p>Google&#8217;s not the first to tackle this problem.  <a href="http://www.thinkfree.com/">ThinkFree</a> and <a href="http://www.zoho.com/">Zoho</a> already have mature offerings.  Hell, even Microsoft has their <a href="http://officelive.microsoft.com/">Office Live Premium</a> ($39.95/month).  Features vary (Zoho has presentations, MS handles mail and web only).  There is obvious demand and interest for such a product.  So why is has Google&#8217;s entry got enterprises lined up do hand over their data?<br />
<span id="more-30"></span><br />
Just the name.</p>
<p>Google&#8217;s Vice President of Engineering Doug Merrill says that &#8220;for the first time, consumer-grade applications are good enough that they can be used by enterprises,&#8221; but he&#8217;s wrong.  They&#8217;ve been good enough for a while.  For the first time, the applications are backed by a big enough name that enterprises are willing to trust the provider, especially now that the company is asking a fee for the service &#8211; a marked departure from the typical web 2.0 business plan.</p>
<p>But not everybody&#8217;s ready to dump their exchange server and climb aboard the Google Apps train.  There are three problems Google is going to have convincing most companies to switch.</p>
<p><strong>Here&#8217;s the first:</strong>  Google (or anyone else) is going to be hard pressed to match the flexibility of a thick-client productivity suite in a web browser.  This is the number one reason people shrug off Google Apps.  Some may counter and say &#8220;well, 80% of users only use 20% of the functionality,&#8221; but it&#8217;s never the same 20%.  Chances are 80% of the users are going to be slightly annoyed that they can&#8217;t find [insert feature here], the other 20% won&#8217;t even consider it.</p>
<p>The fix?  Well, it depends if you consider it a problem.  Google doesn&#8217;t.  Google has repeatedly said (even after the announcement of PE) that they aren&#8217;t aiming to take market share from Office.  And there is absolutely no reason that the two can&#8217;t exist side-by-side.</p>
<p>I am willing to bet that within a year, Google will release a plug-in for Office that wires the current working Word/Excel/PowerPoint (presentations are coming &#8211; don&#8217;t worry) document right into Google Apps.  Extrapolating, it&#8217;s only a matter of time before similar plug-ins are available for all the major productivity suites such as OpenOffice and iWork.  Imagine no more file incompatibility issues, the filetype is always Google.</p>
<p><strong>Problem Two:</strong>  A good number of companies will not feel comfortable having all their sensitive business data floating around outside their network.</p>
<p>Instead of sending your information out to Google, bring Google in with your information (if it isn&#8217;t already).  Google already offers Google-in-a-box search appliances.  There&#8217;s nothing stopping them from just installing Google Apps on one of their machines you&#8217;ve already got in your wired up to your existing network if that&#8217;s what you prefer.</p>
<p><strong>Problem Three:</strong> Connectivity</p>
<p>If your office makes the move to Google Apps and the connection to the web goes down, you&#8217;re effectively boned.  And it&#8217;s even more frustrating if the outage is at Google&#8217;s end and out of your control.  <a href="http://www.salesforcewatch.com/2005/12/user_reaction_t.html">Salesforce.com has already run into this</a>.  Google&#8217;s 99.9% uptime may not be good enough.</p>
<p>But this problem has a solution on the way. Robert O’Callahan of Mozilla recently announced that <a href="http://www.readwriteweb.com/archives/firefox_3_offline_apps.php">Firefox 3 will support offline applications</a>.  Properly instrumented, users may not even notice the disconnection.</p>
<p><strong>Where Google Apps will win</strong><br />
Features.  New ones.</p>
<p>Google will easily convince CIOs everywhere with their $50/user-year price tag, but they&#8217;ll have a riot on their hands if the end users are frustrated by the experience.  Google makes very user friendly software, but I&#8217;m more concerned about the temptation to try and match Word feature-for-feature and ending up with ones that translate poorly onto the web.</p>
<p>The key is to offer features that are useful, but that users can&#8217;t find anywhere else.  Google&#8217;s already hitting this with their very well done Online Collaboration tool and the automatic revision history (something that should have been implemented in Office long ago).</p>
<p>I&#8217;m also excited to see what Google does with their APIs.  Integration with the other SaaS movers and shakers such as <a href="http://www.salesforce.com/">Salesforce.com</a> or <a href="http://www.crystalreports.com/">CrystalReports.com</a> will be a tougher feature to match at the packed software level.  Expect people to jump the MS ship just for that.</p>
<p>Heads up to opportunists:  Learn Google Apps APIs as soon as you can.  I have a hunch that integration and migration to Google Apps will be problems looking for solutions in no time at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://sean.lyn.ch/2007/02/google-apps-premiers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

