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

Evan Gilbert <uidude@google.com> Wed, 05 May 2010 17:58 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 57E9828C0ED for <oauth@core3.amsl.com>; Wed, 5 May 2010 10:58:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -101.829
X-Spam-Level:
X-Spam-Status: No, score=-101.829 tagged_above=-999 required=5 tests=[AWL=0.288, BAYES_20=-0.74, FM_FORGED_GMAIL=0.622, GB_I_LETTER=-2, 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 dZBVooZPJKSw for <oauth@core3.amsl.com>; Wed, 5 May 2010 10:57:59 -0700 (PDT)
Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.35]) by core3.amsl.com (Postfix) with ESMTP id C4B6D3A6A4D for <oauth@ietf.org>; Wed, 5 May 2010 10:57:57 -0700 (PDT)
Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id o45HvgqN010264 for <oauth@ietf.org>; Wed, 5 May 2010 10:57:43 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1273082263; bh=xVTqBMsgJ3u+jqp0WVUNXZARV8g=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bxr8UDuAbStB/2wwiIMY9YDvMNCr24IZ3HPASdpyHQhLKvJC7759ir0MRcPHcU8YS sbqn/SNlmBue/7zwQgGLA==
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=m6SdN0iVZ0wNC8NUzMK2PoRi4Uj6289ntiGrjdbvEScXX3DHDwg/lg3NnAHNfFEyJ 53aP43WZcr14eDjY8aD2Q==
Received: from qyk31 (qyk31.prod.google.com [10.241.83.159]) by wpaz1.hot.corp.google.com with ESMTP id o45HuvLc009365 for <oauth@ietf.org>; Wed, 5 May 2010 10:57:41 -0700
Received: by qyk31 with SMTP id 31so7960603qyk.25 for <oauth@ietf.org>; Wed, 05 May 2010 10:57:41 -0700 (PDT)
Received: by 10.224.66.23 with SMTP id l23mr5911495qai.346.1273082260806; Wed, 05 May 2010 10:57:40 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.7.136 with HTTP; Wed, 5 May 2010 10:57:20 -0700 (PDT)
In-Reply-To: <t2k68fba5c51005051024k70c424e8xac898ef9711c1e47@mail.gmail.com>
References: <9890332F-E759-4E63-96FE-DB3071194D84@gmail.com> <v2j68fba5c51004282044o3a5f96cfucb1157d3884d8cd2@mail.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> <AANLkTilA40XmbIShf3m139IodJRCWUvAouyuHbWcgga7@mail.gmail.com> <t2k68fba5c51005051024k70c424e8xac898ef9711c1e47@mail.gmail.com>
From: Evan Gilbert <uidude@google.com>
Date: Wed, 05 May 2010 10:57:20 -0700
Message-ID: <AANLkTikxNAbTsJQGYBVot-ufxv5-tZfSkaoZIhRf1Ktk@mail.gmail.com>
To: Robert Sayre <sayrer@gmail.com>
Content-Type: multipart/alternative; boundary="00c09f89962cecf25c0485dc8f48"
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 17:58:00 -0000

On Wed, May 5, 2010 at 10:24 AM, Robert Sayre <sayrer@gmail.com> wrote:

> On Wed, May 5, 2010 at 1:06 PM, Evan Gilbert <uidude@google.com> wrote:
> >
> >
> > 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.
> >
> > Responses that are returned via a browser URL should
> > be application/x-www-form-urlencoded.
>
> I'm not sure I understand here, could you explain in more detail?
>

Sorry, should have been clearer here. Think that any response sent to a
redirect_uri should be form encoded.

The "via a browser" comment was to clarify the goal - it's because this is
sent via HTTP GET to a web server (or other client - JS, installed app -
reading the browser path).

JSON only adds complexity for these cases - the client needs to understand
how to parse URL parameters anyway to get the JSON content, so you're adding
a separate encoding layer.

Non-redirect responses and HTTP POST requests are more interesting.


>
> > These parameters are standard to parse
> > in any HTTP handling library
>
> Any HTTP handling library will claim to support it, but I doubt very
> many non-browser libraries match the HTML5 spec. Don't you find the
> requirements there to be complex relative to JSON?
>

See notes above - all clients need to know how to parse URL parameters
anyway. So we just have to decide on whether we want an additional JSON
requirement.


> > and JSON only adds complexity and external
> > library requirements.
>
> Anything in a browser won't care either way. And won't other HTTP
> clients likely end up talking to a JSON API anyway?
>
> >
> >  But if we support both JSON and application/x-www-form-urlencoded
>
> That is design-by-committee. Let's not do that.
>

All requests and HTTP redirect responses probably need to be HTTP GET
(unless we change the spec significantly) - think this means that we are
supporting form encoding.

For responses, think that sending JSON would be OK. Web serving is often
asymmetrical this way (url params in, HTML out)


> --
>
> Robert Sayre
>
> "I would have written a shorter letter, but I did not have the time."
>