Re: [OAUTH-WG] Using OAuth to get a JWT/SAML token

Lewis Adam-CAL022 <Adam.Lewis@motorolasolutions.com> Thu, 19 April 2012 21:38 UTC

Return-Path: <Adam.Lewis@motorolasolutions.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8F02911E80D2 for <oauth@ietfa.amsl.com>; Thu, 19 Apr 2012 14:38:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.466
X-Spam-Level:
X-Spam-Status: No, score=-0.466 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1, UNRESOLVED_TEMPLATE=3.132]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PA89LWPo0Vms for <oauth@ietfa.amsl.com>; Thu, 19 Apr 2012 14:38:11 -0700 (PDT)
Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe003.messaging.microsoft.com [216.32.181.183]) by ietfa.amsl.com (Postfix) with ESMTP id 0CBD211E8096 for <oauth@ietf.org>; Thu, 19 Apr 2012 14:38:10 -0700 (PDT)
Received: from mail103-ch1-R.bigfish.com (10.43.68.254) by CH1EHSOBE015.bigfish.com (10.43.70.65) with Microsoft SMTP Server id 14.1.225.23; Thu, 19 Apr 2012 21:38:10 +0000
Received: from mail103-ch1 (localhost [127.0.0.1]) by mail103-ch1-R.bigfish.com (Postfix) with ESMTP id 029924C025F for <oauth@ietf.org>; Thu, 19 Apr 2012 21:38:10 +0000 (UTC)
X-SpamScore: -26
X-BigFish: PS-26(zzbb2dI9371Ic85fh98dK14ffIzz1202hzz1033IL8275bh8275dhz2fh2a8h683h839hd25h)
X-Forefront-Antispam-Report: CIP:129.188.136.17; KIP:(null); UIP:(null); IPV:NLI; H:il06msg01.mot-solutions.com; RD:none; EFVD:NLI
Received-SPF: pass (mail103-ch1: domain of motorolasolutions.com designates 129.188.136.17 as permitted sender) client-ip=129.188.136.17; envelope-from=Adam.Lewis@motorolasolutions.com; helo=il06msg01.mot-solutions.com ; olutions.com ;
Received: from mail103-ch1 (localhost.localdomain [127.0.0.1]) by mail103-ch1 (MessageSwitch) id 1334871487718060_30710; Thu, 19 Apr 2012 21:38:07 +0000 (UTC)
Received: from CH1EHSMHS013.bigfish.com (snatpool3.int.messaging.microsoft.com [10.43.68.229]) by mail103-ch1.bigfish.com (Postfix) with ESMTP id ACFDF14005A for <oauth@ietf.org>; Thu, 19 Apr 2012 21:38:07 +0000 (UTC)
Received: from il06msg01.mot-solutions.com (129.188.136.17) by CH1EHSMHS013.bigfish.com (10.43.70.13) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 19 Apr 2012 21:38:07 +0000
Received: from il06msg01.mot-solutions.com (il06vts03.mot.com [129.188.137.143]) by il06msg01.mot-solutions.com (8.14.3/8.14.3) with ESMTP id q3JMKqt5010995 for <oauth@ietf.org>; Thu, 19 Apr 2012 17:20:52 -0500 (CDT)
Received: from va3outboundpool.messaging.microsoft.com (va3ehsobe004.messaging.microsoft.com [216.32.180.14]) by il06msg01.mot-solutions.com (8.14.3/8.14.3) with ESMTP id q3JMKpuB010991 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for <oauth@ietf.org>; Thu, 19 Apr 2012 17:20:52 -0500 (CDT)
Received: from mail96-va3-R.bigfish.com (10.7.14.252) by VA3EHSOBE007.bigfish.com (10.7.40.11) with Microsoft SMTP Server id 14.1.225.23; Thu, 19 Apr 2012 21:38:06 +0000
Received: from mail96-va3 (localhost [127.0.0.1]) by mail96-va3-R.bigfish.com (Postfix) with ESMTP id 06B383403FB for <oauth@ietf.org.FOPE.CONNECTOR.OVERRIDE>; Thu, 19 Apr 2012 21:38:06 +0000 (UTC)
Received: from mail96-va3 (localhost.localdomain [127.0.0.1]) by mail96-va3 (MessageSwitch) id 1334871483455180_21352; Thu, 19 Apr 2012 21:38:03 +0000 (UTC)
Received: from VA3EHSMHS021.bigfish.com (unknown [10.7.14.240]) by mail96-va3.bigfish.com (Postfix) with ESMTP id 68B992C0264; Thu, 19 Apr 2012 21:38:03 +0000 (UTC)
Received: from CH1PRD0410HT003.namprd04.prod.outlook.com (157.56.244.181) by VA3EHSMHS021.bigfish.com (10.7.99.31) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 19 Apr 2012 21:37:58 +0000
Received: from CH1PRD0410MB369.namprd04.prod.outlook.com ([169.254.6.182]) by CH1PRD0410HT003.namprd04.prod.outlook.com ([10.255.147.38]) with mapi id 14.16.0143.004; Thu, 19 Apr 2012 21:37:57 +0000
From: Lewis Adam-CAL022 <Adam.Lewis@motorolasolutions.com>
To: Justin Richer <jricher@mitre.org>
Thread-Topic: [OAUTH-WG] Using OAuth to get a JWT/SAML token
Thread-Index: AQHNGZQHGnbSav9o6k2Y2ikZeKN005aitRMw
Date: Thu, 19 Apr 2012 21:37:56 +0000
Message-ID: <59E470B10C4630419ED717AC79FCF9A9090519@CH1PRD0410MB369.namprd04.prod.outlook.com>
References: <59E470B10C4630419ED717AC79FCF9A906E74E@CH1PRD0410MB369.namprd04.prod.outlook.com> <4F885680.5090801@mitre.org>
In-Reply-To: <4F885680.5090801@mitre.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [150.130.9.149]
Content-Type: multipart/alternative; boundary="_000_59E470B10C4630419ED717AC79FCF9A9090519CH1PRD0410MB369na_"
MIME-Version: 1.0
X-MS-Exchange-CrossPremises-AuthAs: Internal
X-MS-Exchange-CrossPremises-AuthMechanism: 04
X-MS-Exchange-CrossPremises-AuthSource: CH1PRD0410HT003.namprd04.prod.outlook.com
X-MS-Exchange-CrossPremises-SCL: -1
X-MS-Exchange-CrossPremises-messagesource: StoreDriver
X-MS-Exchange-CrossPremises-BCC:
X-MS-Exchange-CrossPremises-rules-execution-history: Sample Spam Submissions
X-MS-Exchange-CrossPremises-processed-by-journaling: Journal Agent
X-MS-Exchange-CrossPremises-ContentConversionOptions: False;00160000;True;;
X-OrganizationHeadersPreserved: CH1PRD0410HT003.namprd04.prod.outlook.com
X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn%
X-FOPE-CONNECTOR: Id%1294$Dn%MITRE.ORG$RO%2$TLS%3$FQDN%msgate.mot-solutions.com$TlsDn%
X-FOPE-CONNECTOR: Id%1294$Dn%IETF.ORG$RO%2$TLS%3$FQDN%msgate.mot-solutions.com$TlsDn%
X-CFilter-Loop: Reflected
X-OriginatorOrg: motorolasolutions.com
Cc: "oauth@ietf.org" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Using OAuth to get a JWT/SAML token
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Thu, 19 Apr 2012 21:38:13 -0000

Hi Justin,

There is one thing I have not understood about the whole external browser vs. embedded browser guidance ... and that is, why is *any* browser needed?  Java for example has an HTTP library, and OAuth is RESTful.  So why is it necessary to require the web browser at all, whether external or embedded?  Why can't my native client make RESTful API calls to the AS and RS natively?

Tx!
adam

From: Justin Richer [mailto:jricher@mitre.org]
Sent: Friday, April 13, 2012 11:38 AM
To: Lewis Adam-CAL022
Cc: oauth@ietf.org
Subject: Re: [OAUTH-WG] Using OAuth to get a JWT/SAML token

If the mobile device has a web browser (such as a smart phone), then this is pretty easy, and you've got a couple of options.

One of the best options when the token is on behalf of an end user is, in my opinion, to use the authorization code flow like this: First, register what's called a "public client" with your server -- so you'll get an ID but not a client secret. With that client ID, register a custom-scheme callback URI, like "myapp://oauthcallback", and register your app on the device as the handler for "myapp".

In your application, to start things off, you fire off a web browser to the authorization server's authorization endpoint. The user logs in to the authorization server through the web browser, approves this copy of your app, and gets redirected to "myapp://oauthcallback?code=basdf132". Your app grabs the "myapp://" url and plucks the authorization code off the end of it. Your app then takes that code and sends it in the background to the token endpoint to exchange for a token.

Some key points:

1) You need to have access to a web browser on the platform, and it's considered best practice to push the user to the external browser application on the platform instead of embedding one. There are a couple paragraphs in the spec's security considerations section that talk about this.
2) Your app is "public" because you can't publish it with a secret at configuration time. It can, however, keep the tokens secret at runtime.
3) You need to be very careful with how you store the tokens on the device -- they need to be in a trusted space where other apps on the device can't sniff them out.
4) Another app can try to register "myapp://" and intercept your code on the way through, so make sure your codes are all one time use and short lived.

None of this is just theoretically possible, people are doing it today. What libraries and stuff you'd be after depends wholly on your platform (both server and client side).

 -- Justin

On 04/12/2012 03:01 PM, Lewis Adam-CAL022 wrote:
Hi all,

I've been talking to some of you off line about this already, but I need some help in terms of implementation.  I would like to use OAuth as a means to get either a JWT or SAML token to a client running on a handheld device.  This is something that I'm looking to prototype (as part of a larger project) beginning this week.  So, it is important to me to understand the divide between what is theoretically possible and what is actually possible.

Anybody aware of any implementations out there, either vendor or open source, that I can use for this?

Tx!
adam




_______________________________________________

OAuth mailing list

OAuth@ietf.org<mailto:OAuth@ietf.org>

https://www.ietf.org/mailman/listinfo/oauth