Re: [OAUTH-WG] Open Issues: Group Survey (respond by 5/13)

Kris Selden <kris.selden@gmail.com> Fri, 14 May 2010 20:29 UTC

Return-Path: <kris.selden@gmail.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 4DEAA3A6902 for <oauth@core3.amsl.com>; Fri, 14 May 2010 13:29:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Level:
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[BAYES_50=0.001]
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 rUxeqpF7tIMa for <oauth@core3.amsl.com>; Fri, 14 May 2010 13:29:37 -0700 (PDT)
Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by core3.amsl.com (Postfix) with ESMTP id 189C63A6403 for <oauth@ietf.org>; Fri, 14 May 2010 13:29:37 -0700 (PDT)
Received: by pxi19 with SMTP id 19so1731569pxi.31 for <oauth@ietf.org>; Fri, 14 May 2010 13:29:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=jUviMd0xDwd4vACRd1NwUWCYb2yk88VDR5MGM1Z8aTM=; b=RXXM+92mot9CHhJky5QpZMR2jIDEz974Jf4C055k65L7PAXczrusq0h31hAKd7dPU2 BhmMzjkNOKXBxfppwt9AsSOOLYtKn9lPYfL0COATXyQLaCXus3CwDPuAW3jOiH3SmAkc gdZ70sZmfyuzKhdiF5Kde06ETZc7I3Q79Hb4o=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=HCe8SU/pkD9hYPXiPJdrwwGqqzX+bXjUU3iWewCFwCTv04/yEU7TjtmuOd0lYa82xT 7l0UZFPtw7BoY9Mrk2hvubD9tO8/JANKq+KE3441VzMVCrMtSPvnav8z0X1qP0LeUfz+ A5PfwA28CXA/bFsCPulhb8hE2CcUtxh4drCAk=
Received: by 10.114.54.1 with SMTP id c1mr1538988waa.61.1273868965084; Fri, 14 May 2010 13:29:25 -0700 (PDT)
Received: from [172.16.2.2] (c-76-121-106-185.hsd1.wa.comcast.net [76.121.106.185]) by mx.google.com with ESMTPS id c14sm22817300waa.1.2010.05.14.13.29.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 May 2010 13:29:21 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset="us-ascii"
From: Kris Selden <kris.selden@gmail.com>
In-Reply-To: <90C41DD21FB7C64BB94121FBBC2E72343B3B6989D0@P3PW5EX1MB01.EX1.SECURESERVER.NET>
Date: Fri, 14 May 2010 13:29:18 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <09A6EF98-7406-43D8-9B1C-C16E38CA35D1@gmail.com>
References: <ADB082E11CEB5D49A3CC03E49DCECE02378CB8A679@P3PW5EX1MB01.EX1.SECURESERVER.NET> <90C41DD21FB7C64BB94121FBBC2E72343B3B698808@P3PW5EX1MB01.EX1.SECURESERVER.NET> <7C01E631FF4B654FA1E783F1C0265F8C4A42BFCC@TK5EX14MBXC117.redmond.corp.microsoft.com> <90C41DD21FB7C64BB94121FBBC2E72343B3B69895B@P3PW5EX1MB01.EX1.SECURESERVER.NET> <AANLkTimiSqQjOsxDMxFGjIkP3xDQVHge6OJUPu9CYxHf@mail.gmail.com> <90C41DD21FB7C64BB94121FBBC2E72343B3B6989D0@P3PW5EX1MB01.EX1.SECURESERVER.NET>
To: Eran Hammer-Lahav <eran@hueniverse.com>
X-Mailer: Apple Mail (2.1078)
X-Mailman-Approved-At: Mon, 17 May 2010 08:28:00 -0700
Cc: "OAuth WG (oauth@ietf.org)" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Open Issues: Group Survey (respond by 5/13)
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: Fri, 14 May 2010 21:02:58 -0000

The only reason I've heard was interoperability but it is always stated as patently obvious without a given reasoning. My assumption is this is concern of OAuth 2 client library authors who don't want to depend on 3 parsing libraries but want to state they can inter-operate with any OAuth 2 provider.

I have a suggestion to mitigate the client library dependency issue, an argument for why C is more "interoperable" (even why the server should be not be required to support all 3 formats), comments on encoding, and percent encoding issues with OAuth 1.

Basically, what OAuth providers return are key/value pairs and this discussion is really an issue of serialization.

Instead of depending on libraries, client providers could have a interface for serialization that takes a mime type and string and returns a structure of key value pairs. That way if I've already chosen libyajl (which it is, even though it is UTF8 only) as my favorite JSON library, I can plug it in.

Chances are your client library is going to still be more bloated than me just writing to a testable spec for the flows I need. Maybe even unusable simply because I'm using an API from an application on an evented server and your library uses blocking I/O for making the requests.

On to why C is more interoperable and why as a consumer having it just be one format, doesn't help me unless I'm only using JSON APIs, it only helps the OAuth 2 client library developer.

Let's say API A supports JSON, API B supports XML and API C supports both (as many APIs do, oh no the horror of the QA matrix).

If I'm consuming API A, be nice if the OAuth 2 endpoint used JSON. If I'm consuming API B would be nice if the endpoint supported XML. If I needed both A and B, I need 2 parsers anyways, so what the endpoint did doesn't matter but I would pick JSON. If A and C I would want JSON. If B and C I would want XML.

On the server side, would be nice if a service could match the OAuth endpoint format. I don't really see a need to support all 3 since in order to use my JSON only API you need a JSON parser anyway.

There is little point to an API support multiple formats as many do if the OAuth endpoints require JSON only.

If my service is just a REST storage API, accepting binary files like images, I just want whatever the simplest to parse in which case I would like form-encoded. I really don't see why people think that format is complicated, been in use a long time, there is lots of library support, and is more trivial to write your own parser than both JSON and XML.

The problem with application/x-www-form-urlencoded that was complicated in OAuth 1, had to do with signature base strings because some characters could be optionally encoded and various libraries did this. Here we are talking about key/value pair serialization that HTML forms have been using for a long time. The percent encoding is of bytes and the bytes character set is defined by the charset in the response header. Would not matter if some characters were optionally percent encoded, they would still be decoded.

While a lot of clients may not have an application/x-www-form-urlencoded parser, this problem is way overblown. Most have a percent-encoding decoder, needed just to parse URLs. Splitting on & and = then replacing + with space is trivial. This can easily be done in JavaScript, which is where I suspect some of the JSON only momentum is coming from.

Not all JSON libraries handle the NULL position UTF detection in the RFC 4627, some just assume UTF8 only. I'm guessing supporting the other Unicode transfer encodings isn't all that popular since UTF8 is a superset of ASCII.

Even though JSON maybe the way of the future, more SDKs like the iPhone come with a XML parser and you'd need to find a third party JSON parser or roll your own.

As for the QA matrix, APIs that have handled multiple formats, have one output structure that is serialized to different formats which helps mitigate testing complexity. Test the one output, then test that that structure can be serialized to the supported formats. You may make that one structure JSON, then have a filter that can translate it to XML.

For OAuth, I think it would increase interoperability if the output was considered key/value string pairs and multiple serialization formats were available, requested through the Accept header.

Or I guess you can make it so OAuth is only for JSON APIs because JSON is the future. Though I seem to remember that being said about XML not long ago. Maybe I'm getting old. I guess I shouldn't use RSS and Atom feeds because they are so last year.

I'm for option C plus relaxing the all 3 formats support to recommended but not required.

On May 13, 2010, at 4:43 PM, Eran Hammer-Lahav wrote:

> Can you give a reason why you are objecting to C.
> 
> EHL
> 
>> -----Original Message-----
>> From: Robert Sayre [mailto:sayrer@gmail.com]
>> Sent: Thursday, May 13, 2010 4:27 PM
>> To: Eran Hammer-Lahav
>> Cc: Yaron Goland; OAuth WG (oauth@ietf.org)
>> Subject: Re: [OAUTH-WG] Open Issues: Group Survey (respond by 5/13)
>> 
>> On Thu, May 13, 2010 at 5:14 PM, Eran Hammer-Lahav
>> <eran@hueniverse.com> wrote:
>>> There is clearly no consensus for either A or B. There was mostly no
>>> objection to C, and the reason given by most of those who objected was
>> client complexity with the current proposal solves.
>> 
>> My objection to C was that your examples were buggy. So, to be tediously
>> explicit:
>> 
>> B, then A. Not C.
>> 
>> - Rob
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>