Re: [OAUTH-WG] application/x-www-form-urlencoded vs JSON (Proposal)

Evan Gilbert <uidude@google.com> Wed, 05 May 2010 18:02 UTC

Return-Path: <uidude@google.com>
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 336E63A6A50 for <oauth@core3.amsl.com>; Wed, 5 May 2010 11:02:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -101.772
X-Spam-Level:
X-Spam-Status: No, score=-101.772 tagged_above=-999 required=5 tests=[AWL=0.204, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, USER_IN_WHITELIST=-100]
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 0qhFJmDm52yW for <oauth@core3.amsl.com>; Wed, 5 May 2010 11:02:13 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.35]) by core3.amsl.com (Postfix) with ESMTP id AD9CA3A6A43 for <oauth@ietf.org>; Wed, 5 May 2010 11:02:12 -0700 (PDT)
Received: from kpbe17.cbf.corp.google.com (kpbe17.cbf.corp.google.com [172.25.105.81]) by smtp-out.google.com with ESMTP id o45I1vSc025800 for <oauth@ietf.org>; Wed, 5 May 2010 11:01:58 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1273082518; bh=UWJeWAcuN31++O/+w0hq0NJZ24s=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jna6tHVFOymYplUqHz7nJ+DODPR5jDKVnycCEknmdm6LfZ9VIyDcmqz8VVAI8/UHA dwubMBloc97PoSQob07Pg==
DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:from:date:message-id: subject:to:cc:content-type:x-system-of-record; b=INReENYecrghSpUAiMDRGuS0cQaTV5Q2uCNQLjaiWoU4Q5hKUdmpIbARzHOSLg64i CYF7oN1mPyT0EAV2PZBKQ==
Received: from qyk34 (qyk34.prod.google.com [10.241.83.162]) by kpbe17.cbf.corp.google.com with ESMTP id o45I1R3W007447 for <oauth@ietf.org>; Wed, 5 May 2010 11:01:56 -0700
Received: by qyk34 with SMTP id 34so6485015qyk.10 for <oauth@ietf.org>; Wed, 05 May 2010 11:01:56 -0700 (PDT)
Received: by 10.224.116.137 with SMTP id m9mr5872685qaq.162.1273082504176; Wed, 05 May 2010 11:01:44 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.7.136 with HTTP; Wed, 5 May 2010 11:01:23 -0700 (PDT)
In-Reply-To: <AANLkTil2_9KOm1eRoC0jxvH99E55K3BEW-T5cgWLay9H@mail.gmail.com>
References: <9890332F-E759-4E63-96FE-DB3071194D84@gmail.com> <4BD9E1E3.7060107@lodderstedt.net> <7C01E631FF4B654FA1E783F1C0265F8C4A3EF0B0@TK5EX14MBXC115.redmond.corp.microsoft.com> <z2yf5bedd151004291440g17693f8du9e19a649bef925e4@mail.gmail.com> <w2odaf5b9571004291509x8895a73k384a4b4ddb12b794@mail.gmail.com> <20100430105935.20255m8kdythy6sc@webmail.df.eu> <90C41DD21FB7C64BB94121FBBC2E723439323D0DB0@P3PW5EX1MB01.EX1.SECURESERVER.NET> <AANLkTik3NSJynWfiNWovruPEOT2Y6G1zcWPFOaS_pHdy@mail.gmail.com> <4BE1AF25.7000308@lodderstedt.net> <AANLkTil2_9KOm1eRoC0jxvH99E55K3BEW-T5cgWLay9H@mail.gmail.com>
From: Evan Gilbert <uidude@google.com>
Date: Wed, 05 May 2010 11:01:23 -0700
Message-ID: <AANLkTilWV3VVBROXZuky5OLNzM2hz27pEqwG1l6W2Uc1@mail.gmail.com>
To: Torsten Lodderstedt <torsten@lodderstedt.net>
Content-Type: multipart/alternative; boundary="00c09f9db11b6f4c690485dc9eec"
X-System-Of-Record: true
Cc: "oauth@ietf.org" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] application/x-www-form-urlencoded vs JSON (Proposal)
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: Wed, 05 May 2010 18:02:14 -0000

On Wed, May 5, 2010 at 10:59 AM, Evan Gilbert <uidude@google.com> wrote:

>
>
> On Wed, May 5, 2010 at 10:47 AM, Torsten Lodderstedt <
> torsten@lodderstedt.net> wrote:
>
>> Even if not supported directly by the platform there are many JSON
>> libraries available these days.
>>
>
> It's not hard to add JSON support, but it's a factor in the choice.
>
>
>>
>> http://www.json.org/ lists 3 libraries for Objective-C alone.
>>
>> Moreover, the JSON documents we are discussing now are simple, something
>> like
>>
>>
>> { "access_token": "SlAV32hkKG", "expires_in": "3600", "refresh_token":
>> "8xLOxBtZp8" }
>>
>> Parsing such a document is not a challenge even without library support.
>>
>
> Per notes above - the client needs to do understand form encoding anyway.
> The client needs to parse the redirect_uri and also needs to generate form
> encoded requests.
>

Also, for the User-Agent flow, parsing potentially untrusted JSON in
JavaScript is difficult. The normal path of using eval() is unsafe and leads
to XSS holes - you need to run regex matcher to verify that the JSON content
has no executable code.


>
>
>>
>> Regarding code size: What really matters on mobile devices from my point
>> of view is the size of data to be transmitted. Here, JSON is much more
>> compact than XML.
>>
>> regards,
>> Torsten.
>>
>> Am 05.05.2010 17:42, schrieb Marius Scurtescu:
>>
>>  On Wed, May 5, 2010 at 8:28 AM, Eran Hammer-Lahav<eran@hueniverse.com>
>>>  wrote:
>>>
>>>
>>>> I'll add something to the draft and we'll discuss it. There is enough
>>>> consensus on a single JSON response format.
>>>>
>>>>
>>> Yesterday I got the following feedback:
>>>
>>> On Tue, May 4, 2010 at 5:43 PM, Greg Robbins<grobbins@google.com>
>>>  wrote:
>>>
>>>
>>>> Using JSON on the iPhone requires developers to drag in source code for
>>>> a
>>>> third-party library.
>>>>
>>>> If their app isn't already relying on JSON for some other purpose, then
>>>> adding a third-party library is a somewhat substantial annoyance,
>>>> particularly for a mobile app where code size is important.
>>>>
>>>> If OAuth 2 is only intended for use with JSON APIs, then returning all
>>>> responses as JSON is reasonable. Otherwise, it's not so reasonable. A
>>>> full
>>>> JSON parser is non-trivial, and seems like overkill for simple
>>>> responses.
>>>>
>>>> The iPhone OS does have libxml2 and an event-style XML parser, but no
>>>> really
>>>> easy way to extract data from XML, either.
>>>>
>>>> Form-style responses are much more straightforward to worth with given
>>>> simple string-manipulation utilities.
>>>>
>>>>
>>> If the above is true, then I am not so sure about JSON anymore. Lots
>>> of phones and devices will have problems with it.
>>>
>>> Marius
>>>
>>>
>>
>>
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
>>
>
>