Re: [OAUTH-WG] oauth with command line clients

Phil Hunt <> Mon, 12 June 2017 18:34 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 4E83712EAF1 for <>; Mon, 12 Jun 2017 11:34:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.732
X-Spam-Status: No, score=-1.732 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=1.989, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id UQ8RePsTh53C for <>; Mon, 12 Jun 2017 11:34:23 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 4EB0012960D for <>; Mon, 12 Jun 2017 11:34:23 -0700 (PDT)
Received: from ( []) by (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v5CIYLHj010878 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2017 18:34:21 GMT
Received: from ( []) by (8.14.4/8.14.4) with ESMTP id v5CIYKqG025790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jun 2017 18:34:20 GMT
Received: from ( []) by (8.14.4/8.14.4) with ESMTP id v5CIYIFV029703; Mon, 12 Jun 2017 18:34:19 GMT
Received: from [] (/ by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 12 Jun 2017 11:34:18 -0700
From: Phil Hunt <>
Message-Id: <>
Content-Type: multipart/alternative; boundary="Apple-Mail=_51CFB8D3-007B-4FFF-B89A-AAB80FEB2A5C"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Date: Mon, 12 Jun 2017 11:34:16 -0700
In-Reply-To: <>
Cc: Aaron Parecki <>, Bill Burke <>, OAuth WG <>
To: Justin Richer <>
References: <> <> <>
X-Mailer: Apple Mail (2.3273)
X-Source-IP: []
Archived-At: <>
Subject: Re: [OAUTH-WG] oauth with command line clients
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: OAUTH WG <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 12 Jun 2017 18:34:26 -0000


The point of OAuth is to break away from using UID/Password (basic auth).   

The device flow is the best way to allow stronger authentication of the authorizing user while still allowing a limited input device (e.g. command line) to work.

Oracle Corporation, Identity Cloud Services Architect & Standards
@independentid <> <>
> On Jun 12, 2017, at 11:22 AM, Justin Richer <> wrote:
> I second the recommendation to use the device flow for this kind of system. The commandline client would print out a text string for the user to enter into their browser elsewhere. 
> If you can pop up a system browser then it's even easier and you can just use the auth code flow, but it's a lot to assume that a commandline app can have that kind of capability available to it. Printing out a string? That's easy and universal. That's why I say go with the device flow.
> The thing is, at the end of the day, you need the user to authenticate to the AS if you're going to get delegated access from them. That's really the whole point of the OAuth protocol, after all. So you can either do that in a local browser of some kind (like popping a system browser), on another device (with the device flow), or you can be evil and use the username/password grant and just steal the user's credentials yourself. If it's not clear, I don't recommend that, basically ever. 
>  -- Justin
> On 6/11/2017 11:58 PM, Aaron Parecki wrote:
>> I've seen this done a few ways:
>> * The Device Flow: <> which is what you see on browserless devices like the Apple TV logging in to a cable provider from your phone. A short code is generated and displayed on the screen, you launch a browser on your phone and enter the code. This would work just as well from the command line on the same device.
>> * I've also seen apps use the authorization flow, by displaying the authorization URL on the command line prompt and instructing the user to open it in a browser. The redirect URI is a hosted web page that displays the authorization code and instructs the user to paste it back at the terminal.
>> * The command line app can launch an HTTP server on localhost and use that as the redirect URL for the authorization code flow. This option ends up being the most seamless since it works like a traditional flow without any special instructions to the user.
>> ----
>> Aaron Parecki
>> <>
>> @aaronpk <>
>> On Sun, Jun 11, 2017 at 8:52 PM, Bill Burke < <>> wrote:
>> Has anybody done any spec work around doing oauth from command line interfaces?  We're looking for something where the auth server can generate text-based challenges that are rendered in the console window that query for simple text input over possibly multiple requests.  I'm not talking about Resource Owner or Client Credentials grant.  The command line client may not know the credential types required for a successful token request. It would be easy to write a simple protocol, but I'd rather just do something around any existing internet draft or rfc that somebody has put some thought into.  Hope I'm making sense here.
>> Thanks,
>> Bill Burke
>> Red Hat
>> _______________________________________________
>> OAuth mailing list
>> <>
>> <>
>> _______________________________________________
>> OAuth mailing list
>> <>
>> <>
> _______________________________________________
> OAuth mailing list