<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Login to the Foursquare API v2 from Android with OAuth</title>
	<atom:link href="http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/</link>
	<description>Just another European geek in Silicon Valley</description>
	<lastBuildDate>Fri, 13 Jan 2012 05:33:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Simon</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-1211</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Fri, 13 Jan 2012 05:33:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-1211</guid>
		<description>the 2 step process i describe is according the foursquare documentation. there might be other undocumented ways to achieve the same, but there is a risk that this functionality could change in the future.

for more information, please see the official documentation: &lt;a href=&quot;https://developer.foursquare.com/overview/auth&quot; rel=&quot;nofollow&quot;&gt;https://developer.foursquare.com/overview/auth&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>the 2 step process i describe is according the foursquare documentation. there might be other undocumented ways to achieve the same, but there is a risk that this functionality could change in the future.</p>
<p>for more information, please see the official documentation: <a href="https://developer.foursquare.com/overview/auth" rel="nofollow">https://developer.foursquare.com/overview/auth</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: suraj g sakhardane</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-1207</link>
		<dc:creator>suraj g sakhardane</dc:creator>
		<pubDate>Thu, 12 Jan 2012 11:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-1207</guid>
		<description>Its a wonderful and very helpful post.1 question i was having is that we can make response_type=token in the the following query and get the access token directly (in which case access token is appended to the callback url/registered redirect url ) then why we need to do a 2 step process?

https://foursquare.com/oauth2/authenticate?client_id={YOUR_CLIENT_ID}&amp;response_type=code&amp;redirect_uri={YOUR_DEFINED_SCHEME}

ie
https://foursquare.com/oauth2/authenticate?client_id={YOUR_CLIENT_ID}&amp;response_type=token&amp;redirect_uri={CALL_BACK_URL}

gives

CALL_BACK_URL#access_token=ACCESS_TOKEN

I tried this in the browser n it working.It is asking for authentication and later redirecting to CALL_BACK_URL with access token appended to it!</description>
		<content:encoded><![CDATA[<p>Its a wonderful and very helpful post.1 question i was having is that we can make response_type=token in the the following query and get the access token directly (in which case access token is appended to the callback url/registered redirect url ) then why we need to do a 2 step process?</p>
<p><a href="https://foursquare.com/oauth2/authenticate?client_id=" rel="nofollow">https://foursquare.com/oauth2/authenticate?client_id=</a>{YOUR_CLIENT_ID}&amp;response_type=code&amp;redirect_uri={YOUR_DEFINED_SCHEME}</p>
<p>ie<br />
<a href="https://foursquare.com/oauth2/authenticate?client_id=" rel="nofollow">https://foursquare.com/oauth2/authenticate?client_id=</a>{YOUR_CLIENT_ID}&amp;response_type=token&amp;redirect_uri={CALL_BACK_URL}</p>
<p>gives</p>
<p>CALL_BACK_URL#access_token=ACCESS_TOKEN</p>
<p>I tried this in the browser n it working.It is asking for authentication and later redirecting to CALL_BACK_URL with access token appended to it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-879</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Mon, 24 Oct 2011 21:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-879</guid>
		<description>i have never seen this error on my side, nor does google return anything when searching for it. you might try to add a path to your url (like simontest-android-app://mypath), but my guess is that the problem lies somewhere else.</description>
		<content:encoded><![CDATA[<p>i have never seen this error on my side, nor does google return anything when searching for it. you might try to add a path to your url (like simontest-android-app://mypath), but my guess is that the problem lies somewhere else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Márcio Martins</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-876</link>
		<dc:creator>Márcio Martins</dc:creator>
		<pubDate>Mon, 24 Oct 2011 00:01:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-876</guid>
		<description>Hi!
OAuth Consumer Registration doesn&#039;t accept the simontest-android-app:// pattern anymore, returning the following error: Your URL needs a body too (just http:// won&#039;t work).
Can you advise? Thanks!</description>
		<content:encoded><![CDATA[<p>Hi!<br />
OAuth Consumer Registration doesn&#8217;t accept the simontest-android-app:// pattern anymore, returning the following error: Your URL needs a body too (just http:// won&#8217;t work).<br />
Can you advise? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-197</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Tue, 21 Jun 2011 19:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-197</guid>
		<description>Hi Rafael

oauth works in 2 steps: first you need to authorize your app, then you get the access token.

1. https://foursquare.com/oauth2/authenticate?client_id={YOUR_CLIENT_ID}&amp;response_type=code&amp;redirect_uri={YOUR_DEFINED_SCHEME}
2. https://foursquare.com/oauth2/access_token?client_id={YOUR_CLIENT_ID}&amp;client_secret={YOUR_CLIENT_SECRET}&amp;grant_type=authorization_code&amp;redirect_uri={YOUR_DEFINED_SCHEME}&amp;code={CODE_YOU_VE_GOT_IN_STEP_1}

where {YOUR_DEFINED_SCHEME} can actually be anything (&quot;simontest-android-app://&quot; in case of my example)

Simon</description>
		<content:encoded><![CDATA[<p>Hi Rafael</p>
<p>oauth works in 2 steps: first you need to authorize your app, then you get the access token.</p>
<p>1. <a href="https://foursquare.com/oauth2/authenticate?client_id=" rel="nofollow">https://foursquare.com/oauth2/authenticate?client_id=</a>{YOUR_CLIENT_ID}&#038;response_type=code&#038;redirect_uri={YOUR_DEFINED_SCHEME}<br />
2. <a href="https://foursquare.com/oauth2/access_token?client_id=" rel="nofollow">https://foursquare.com/oauth2/access_token?client_id=</a>{YOUR_CLIENT_ID}&#038;client_secret={YOUR_CLIENT_SECRET}&#038;grant_type=authorization_code&#038;redirect_uri={YOUR_DEFINED_SCHEME}&#038;code={CODE_YOU_VE_GOT_IN_STEP_1}</p>
<p>where {YOUR_DEFINED_SCHEME} can actually be anything (&#8220;simontest-android-app://&#8221; in case of my example)</p>
<p>Simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafael Ramos</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-194</link>
		<dc:creator>Rafael Ramos</dc:creator>
		<pubDate>Tue, 21 Jun 2011 01:13:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-194</guid>
		<description>Hi Simon,
Nice tutorial!
I was testing your piece of code but right after I give access to my app on foursquare via browser, I&#039;m being redirected to a page that foursquare cannot handle. It says &#039;we couldn&#039;t find the page you&#039;re looking for&#039;. And then I never get the token nor my callback url is called.

Basically, the url for this &#039;broken&#039; page is: https://foursquare.com/oauth2/mycallback?code=mycode.

Where, &#039;mycallback&#039; is my callback url (ending with ://) and &#039;mycode&#039; is actually my code.
Do you have any idea of what might be happening?
Rafael</description>
		<content:encoded><![CDATA[<p>Hi Simon,<br />
Nice tutorial!<br />
I was testing your piece of code but right after I give access to my app on foursquare via browser, I&#8217;m being redirected to a page that foursquare cannot handle. It says &#8216;we couldn&#8217;t find the page you&#8217;re looking for&#8217;. And then I never get the token nor my callback url is called.</p>
<p>Basically, the url for this &#8216;broken&#8217; page is: <a href="https://foursquare.com/oauth2/mycallback?code=mycode" rel="nofollow">https://foursquare.com/oauth2/mycallback?code=mycode</a>.</p>
<p>Where, &#8216;mycallback&#8217; is my callback url (ending with ://) and &#8216;mycode&#8217; is actually my code.<br />
Do you have any idea of what might be happening?<br />
Rafael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-176</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Tue, 14 Jun 2011 04:13:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-176</guid>
		<description>Hi

there is no need to open the browser again. you can just store the OAuth token in the app after the first login and reuse it the next time.

Simon</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>there is no need to open the browser again. you can just store the OAuth token in the app after the first login and reuse it the next time.</p>
<p>Simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: geykel</title>
		<link>http://blog.simonstahl.com/2011/03/16/login-with-oauth-to-the-foursquare-api-v2-from-android/comment-page-1/#comment-175</link>
		<dc:creator>geykel</dc:creator>
		<pubDate>Tue, 14 Jun 2011 03:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.simonstahl.com/?p=147#comment-175</guid>
		<description>Hello Simon,

Thank you for this great post which helped me a lot to understand how OAuth v2.0 works and how to integrate it to an Android app. I got a question though, I was testing some code that I wrote using your ideas here and everything is working great but I want to change one thing and I want to see if you can give me some directions. My app basically sign in an user to 4sq and then retrieve all the nearby venues, the first time the user sign in, 4sq ask me to authorize my app, that&#039;s ok, but next time the user sign in, the app open the browser again (because we are calling an intent for doing that) this time of course 4sq don&#039;t ask me to authorize the app because we did that already and just call our custom redirect-uri and give us the access_token... so, what I wanted to ask you is, is there any other way of doing this without open the android browser? at least for every sign in after the first one? which is the one where the user authorize the app (we need the browser for that first sign in)...

Sorry for this long comment :)</description>
		<content:encoded><![CDATA[<p>Hello Simon,</p>
<p>Thank you for this great post which helped me a lot to understand how OAuth v2.0 works and how to integrate it to an Android app. I got a question though, I was testing some code that I wrote using your ideas here and everything is working great but I want to change one thing and I want to see if you can give me some directions. My app basically sign in an user to 4sq and then retrieve all the nearby venues, the first time the user sign in, 4sq ask me to authorize my app, that&#8217;s ok, but next time the user sign in, the app open the browser again (because we are calling an intent for doing that) this time of course 4sq don&#8217;t ask me to authorize the app because we did that already and just call our custom redirect-uri and give us the access_token&#8230; so, what I wanted to ask you is, is there any other way of doing this without open the android browser? at least for every sign in after the first one? which is the one where the user authorize the app (we need the browser for that first sign in)&#8230;</p>
<p>Sorry for this long comment <img src='http://blog.simonstahl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

