Re: [OAUTH-WG] Recommended token format

Torsten Lodderstedt <torsten@lodderstedt.net> Fri, 11 June 2010 19:35 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 A0CF63A67DA for <oauth@core3.amsl.com>; Fri, 11 Jun 2010 12:35:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.732
X-Spam-Level:
X-Spam-Status: No, score=-0.732 tagged_above=-999 required=5 tests=[AWL=0.316, BAYES_50=0.001, GB_I_LETTER=-2, HELO_EQ_DE=0.35, HTML_MESSAGE=0.001, J_CHICKENPOX_12=0.6]
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 ANyZ+cBFnVNM for <oauth@core3.amsl.com>; Fri, 11 Jun 2010 12:35:04 -0700 (PDT)
Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.31.35]) by core3.amsl.com (Postfix) with ESMTP id 8928F3A68CC for <oauth@ietf.org>; Fri, 11 Jun 2010 12:35:03 -0700 (PDT)
Received: from p4fff06ec.dip.t-dialin.net ([79.255.6.236] helo=[127.0.0.1]) by smtprelay01.ispgateway.de with esmtpa (Exim 4.68) (envelope-from <torsten@lodderstedt.net>) id 1ONA0O-0000KB-AS; Fri, 11 Jun 2010 21:35:04 +0200
Message-ID: <4C128FE6.3020801@lodderstedt.net>
Date: Fri, 11 Jun 2010 21:35:02 +0200
From: Torsten Lodderstedt <torsten@lodderstedt.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: Christian Holm <cho@cubitech.dk>
References: <AANLkTikSRWuuIwPxqbCZqis1e6gQ_Q6Yg5j7gDAVB606@mail.gmail.com>
In-Reply-To: <AANLkTikSRWuuIwPxqbCZqis1e6gQ_Q6Yg5j7gDAVB606@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------020903010306040603040802"
X-Df-Sender: 141509
Cc: oauth@ietf.org
Subject: Re: [OAUTH-WG] Recommended token format
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, 11 Jun 2010 19:35:07 -0000

Hi Christian,

in my opinion, the token should be digitally signed in order to detect 
modifications. HMAC-SHA256 or RSA are good candidates for that. If you 
really need encryption depends on your privacy and security requirements.

Typical token contents are: issuer, validity/expiration, audience (could 
be scope), user id, user attributes, digital signature. If revocation is 
a topic, a token id could also be required. You may take a look at 
standards like SAML2 or Kerberos to get inspiration. For simple use 
cases, simple web tokens 
(http://groups.google.com/group/oauth-wrap-wg/files) could also be an 
option.

Note: I don't think a public format is less secure than a private one if 
the security is based on cryptography instead of obscurity :-)

regards,
Torsten

Am 09.06.2010 22:58, schrieb Christian Holm:
> Hi
> We are in the process of defining a REST interface for our 
> application, and are looking to use OAuth 2 as the authentication 
> mechanism. I have read through the latest specification, and it seems 
> like a perfect fit for our needs. Our main dilemma is with regard to 
> the format of the access token. As I understand there are basicly two 
> options:
> * Use the token as an "artifact", ie. just a randomly generated string 
> which is stored centrally. When accessing a resource with the token, 
> the token is verified by looking it up in the central repository and 
> making sure the requested resource can be accessed.
> * Encrypt the authentication into the token. This way the resource 
> server can verify the access directly from the token without checking 
> with the central repository. This is particularly a good idea if the 
> authentication servers and resource servers are hosted in different 
> data centers.
> We would like to go with the second option, but since my cryptology 
> knowledge is less than could be wished, I have a had time deciding on 
> the format. I would assume we would have to put the user, the expiry 
> time and the scopes into the token (perhaps with some random letters 
> in between) and then encrypt that using f.ex. AES. Are there any 
> recommendations on the format and encryption method to use? I realize 
> that publicly disclosing the format could weaken it slightly, so the 
> recommendations will have to be fairly generic.
> Thanks for the help and the excellent work on the OAuth 2.0.
> Christian Holm
>
>
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>