Re: [OAUTH-WG] Quick survey: fragment vs. query

Torsten Lodderstedt <torsten@lodderstedt.net> Tue, 10 August 2010 17:58 UTC

Return-Path: <torsten@lodderstedt.net>
X-Original-To: oauth@core3.amsl.com
Delivered-To: oauth@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 6058E3A6A99 for <oauth@core3.amsl.com>; Tue, 10 Aug 2010 10:58:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.139
X-Spam-Level:
X-Spam-Status: No, score=0.139 tagged_above=-999 required=5 tests=[AWL=-0.868, BAYES_20=-0.74, HELO_EQ_DE=0.35, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=1.396]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IVUKBKWxv-Dx for <oauth@core3.amsl.com>; Tue, 10 Aug 2010 10:58:06 -0700 (PDT)
Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.18.44]) by core3.amsl.com (Postfix) with ESMTP id 9FEBE3A6A8B for <oauth@ietf.org>; Tue, 10 Aug 2010 10:58:05 -0700 (PDT)
Received: from [80.187.108.230] (helo=[10.164.59.182]) by smtprelay02.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from <torsten@lodderstedt.net>) id 1Oit5o-0001b8-3z; Tue, 10 Aug 2010 19:58:39 +0200
References: <C862F736.37253%eran@hueniverse.com> <AANLkTil_MQ1-JxNC-5S3bLDo6-WhG0GMBHVXQvvN-jdv@mail.gmail.com> <AANLkTi=A+ztAH8vbR-O8vYUxiE2cGjn-KHCpM05NE3fL@mail.gmail.com> <8F6F3A55-274C-4F38-84C8-C956D74504AE@lodderstedt.net> <837544.77407.qm@web37602.mail.mud.yahoo.com> <F4265A73-F743-4E5F-BE16-5A7D31308B5A@facebook.com>
In-Reply-To: <F4265A73-F743-4E5F-BE16-5A7D31308B5A@facebook.com>
Mime-Version: 1.0 (iPhone Mail 8A293)
Content-Transfer-Encoding: 7bit
Content-Type: multipart/alternative; boundary="Apple-Mail-3-360674921"
Message-Id: <6A18E244-31B2-46F1-BA10-FC414C185EDB@lodderstedt.net>
X-Mailer: iPhone Mail (8A293)
From: Torsten Lodderstedt <torsten@lodderstedt.net>
Date: Tue, 10 Aug 2010 19:57:28 +0200
To: Luke Shepard <lshepard@facebook.com>
X-Df-Sender: 141509
Cc: Naitik Shah <naitik@facebook.com>, Oleg Gryb <oleg@gryb.info>, OAuth WG <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Quick survey: fragment vs. query
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/oauth>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Aug 2010 17:58:07 -0000

Thank you for the explanation. 

I now understand that the fragment is used for efficiently passing token or code on the client side. What I still don't understand is why a client would need both at once (url 1)? Have you such applications in production?

regards,
Torsten.



Am 10.08.2010 um 19:23 schrieb Luke Shepard <lshepard@facebook.com>:

> Here are the possible URLs:
> 
> http://static.facebook.com/connect/xd_proxy.php#code=10alkji&access_token=lzipa3p
> http://static.facebook.com/connect/xd_proxy.php?code=10alkji#access_token=lzipa3p
> 
> Those who already use this flow in production (including Google, Facebook, Twitter, and others) typically work like this:
> 
> - Parent frame initiates the transaction by spawning a popup or an iframe
> - Response comes back to a static relay file (like the xd_proxy.php above)
> - The relay interprets the URL, parses out arguments, and hands them to the parent frame
> - Parent frame then does what it wants. this could be making an API call via JSONP, handing info to the server via Ajax, or something else.
> 
> Because the relay file is static, it isn't going to interpret the code regardless, even if it is sent in the query parameter. So since the client will handle it anyway, the fragment is better for two reasons:
> 
> 1/ Less code for the JS to just pull it out of the fragment
> 2/ More efficient, as the relay file can be cached on the client. If you include a code then you degrade performance because it busts the cache every time.
> 
> 
> On Aug 10, 2010, at 9:35 AM, Oleg Gryb wrote:
> 
>> I was trying to understand that too (see "Is user agent profile secure" thread). The answers that I've got were:
>> 
>> 1. It's already coded this way.
>> 2. It's the most efficient way of doing that, because that relay.html page is static and can be cached by a browser.
>> 
>> None of the answers above looks very convincing to me, but that's where UA is now. 
>> 
>> From: Torsten Lodderstedt <torsten@lodderstedt.net>
>> Can someone pls. explain why code and token should both be returned in the fragment?
>> 
>> regards,
>> Torsten.
>> 
>> 
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
>