Re: [OAUTH-WG] [UNVERIFIED SENDER] Re: MTLS and in-browser clients using the token endpoint

Brian Campbell <bcampbell@pingidentity.com> Tue, 05 February 2019 23:07 UTC

Return-Path: <bcampbell@pingidentity.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 03B8D12785F for <oauth@ietfa.amsl.com>; Tue, 5 Feb 2019 15:07:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=pingidentity.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N_rOCKa0iH_q for <oauth@ietfa.amsl.com>; Tue, 5 Feb 2019 15:07:13 -0800 (PST)
Received: from mail-it1-x133.google.com (mail-it1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 28DE31277CC for <oauth@ietf.org>; Tue, 5 Feb 2019 15:07:13 -0800 (PST)
Received: by mail-it1-x133.google.com with SMTP id p197so1978910itp.0 for <oauth@ietf.org>; Tue, 05 Feb 2019 15:07:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pingidentity.com; s=gmail; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WpJI/ITitEh7ArxaDwYOVWAG9gfeCzaFN7fr9CU+bSc=; b=QuYn5PqXq5BSbsf2p9LDePojanenIF6FTWrfzQl8BY1Js/Bqyt2o1GLVjeak2qKIo8 xGsDuK7JLJyrnpdtdkj9jnfVcXai1W6kFIF26UFk2lri8p6Np8Lc/ud/ZA8f67DLKXIY xmNeGNfHgBz2PUkvjnf2lBM4r0PUA7KGkF7FU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WpJI/ITitEh7ArxaDwYOVWAG9gfeCzaFN7fr9CU+bSc=; b=F3uszIIH867h87RRXdZ8H+6VycupoeJYFQHaHs08clgL9gn/wttJjALEfRcpWezqvN 8/ohl824wMOUT+CYsAHlXPptQbDYYXRy0hIZW9uJxrXuWY5t2+bWAVx3cZKEHfbJBzZQ x6juRkxsCq/f6HDEYknTD0a7uZOi2+kdULnB30zh5DQn/+wDu6vkQsTPIZ1OjZxmFAFg 53WtWaqhH8z5Apl1qqgvWX4mW5AbVRx4awgnfe6h1RpU9SBVrTWvTXb40i2hZjIsIaOW 70jrQimPW6WD1RGIsptvKGlVyhcetQR4UV7wjjBiBxltDVvhO7sieD5NuJ41q/d378cu GLGQ==
X-Gm-Message-State: AHQUAuYUbji8Oz7yg//AhOz2fj15aCugdERRRtI79aHsbL+CcJPJBAYo 0fhEotJKYyKo5yvhXP6BuNdQaT/FCa56C6jVK6mfpVXoDByAy0vgYE7J1zosKSGy7LBmdHpedwG pCSaOaKpUtDVL2w==
X-Google-Smtp-Source: AHgI3IbncPSKbXPIoI9UVgxTE2NZ9v2BZoWvyqMSR+gESSw+L3By5+PN9LquhVbLwk+xpeXVGqVyW7au1dn8lrJdTSs=
X-Received: by 2002:a24:3644:: with SMTP id l65mr698538itl.124.1549408032272; Tue, 05 Feb 2019 15:07:12 -0800 (PST)
MIME-Version: 1.0
References: <CA+k3eCTKSFiiTw8--qBS0R2YVQ0MY0eKrMBvBNE4pauSr1rHcA@mail.gmail.com> <6A614742-290D-47E2-B3E9-A4D49DB32DD7@forgerock.com> <CA+k3eCSoNRGrsxeLYd6DEqU+U6TB_aXV2aPUa07Um2X0ZH_ZEw@mail.gmail.com> <548FF68E-7775-4FE0-829F-1E9CC6EA8E3F@alkaline-solutions.com> <1119DDAE-8044-43C9-A6D4-6032B3BB62B8@forgerock.com> <9D007408-3BCC-4165-BCA4-083BD7602E7D@alkaline-solutions.com> <CA+k3eCQi1sz2bDOMEATpN9ZvXd+VJydQXG03WKuLczG5kz2z+Q@mail.gmail.com> <CAP-T6TTD-nLGoPHqJ042SzotLorb2mzoWgLxsausWHhRPZr8xA@mail.gmail.com> <CA+k3eCQtgku68usoCFsTeHVnNOLqWs6NweOgpQKsa7_9=wK7Vw@mail.gmail.com> <99d38517-0e25-789f-83ae-9f33e5620475@aol.com> <CA+k3eCQVL4DeRqHWYu6=xXjBK2RnukQ5RxFzRjGZYr4au8bBkQ@mail.gmail.com> <F5841CEA-BA74-4F17-977A-A78922CDC68C@amazon.com> <CA+k3eCT+mPu0=9TDKtuVqXy=zStEWTS5aVOsc2TuJcYQ2cvE6A@mail.gmail.com> <CC05C965-3308-4449-A1E2-EDA0119BE5D2@amazon.com> <5C615068-4D43-4697-B5B1-612F01166828@forgerock.com> <CA+k3eCQnpVG6D3-Q0dConTvM7oAKp6530U2_sRhJHQWKMMCMfQ@mail.gmail.com> <CFEDC47D-4AC7-437C-AA63-EB374C6EB931@alkaline-solutions.com> <9864BB84-3987-4EF9-81C3-45B4387F0B1A@mit.edu> <761DA897-56F2-4201-81BA-04D894DE28BA@forgerock.com>
In-Reply-To: <761DA897-56F2-4201-81BA-04D894DE28BA@forgerock.com>
From: Brian Campbell <bcampbell@pingidentity.com>
Date: Tue, 05 Feb 2019 16:06:45 -0700
Message-ID: <CA+k3eCRKgWG1=PRCRcRq9+xOXLzSbyOX4CC4FQ2mwL8SLvBWoA@mail.gmail.com>
To: Neil Madden <neil.madden@forgerock.com>
Cc: Justin Richer <jricher@mit.edu>, David Waite <david@alkaline-solutions.com>, oauth <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000006051e105812dab35"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/k8XPUfXfEx6I8_at35kiZEceiFk>
Subject: Re: [OAUTH-WG] [UNVERIFIED SENDER] Re: MTLS and in-browser clients using the token endpoint
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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: Tue, 05 Feb 2019 23:07:16 -0000

Filip did some testing along these lines awhile back. Although I think he
was more focused on the other side of things by instructing the fetch/XHR
request to omit sending credentials. The behavior he saw was that he wasn't
able to suppress the certificate selection prompting as expected or hoped.
But I don't think he'd say that the tests were exhaustive or conclusive
(and again wasn't about the ACAC header so much as the request API). Also I
wouldn't be surprised if browser implementations of a rather niche and
software layer crossing part of a living standard aren't fully baked. I
mean, I think the browser has to establish a TLS connection where it will
be asked for client certs during the handshake in order to send the
preflight request so as to get back (or not) the CORS Access-Control
headers. So I guess it would have to ignore the CertificateRequest message
in the handshake (and hope the server considers certs optional) and then,
if the preflight response had ACAC:true, reestablish the TLS connection and
do cert selection prompting before sending the actual request. Or if no
ACAC:true header, then keep using the prior connection. Maybe I've gone off
the rails there but I think the point was that it's complicated and so some
rough edges on the implementations in the wild or misunderstanding of
expected behavior aren't out of the question. Also I think you need
something more on a POST request to the token endpoint, like some custom
header, to trigger the whole preflight dance. A simple POST request is not
preflighted so the ACAC isn't about sending credentials but about the
browser rejecting a response that does not have the ACAC:true header and
not making the response available to the invoking script.

Anyway, with that rambling out of the way, I think that Neil's suggestion
falls into the category of things (along with things like method/body
preserving redirects, renegotiation, post-handshake client auth) that might
be usable to suppress or avoid browser cert selection UX in the arguably
not too common cases it happens.



On Tue, Feb 5, 2019 at 9:17 AM Neil Madden <neil.madden@forgerock.com>
wrote:

> I’m less and less convinced that a redirect is the best way to do this.
>
> I was reading the WHATWG Fetch spec yesterday, in particular the entries
> about CORS, and realised that for cross-origin requests TLS client
> certificates are treated as credentials just like cookies:
> https://fetch.spec.whatwg.org/#credentials
>
>     Credentials are HTTP cookies, TLS client certificates, and
> authentication entries (for HTTP authentication)
>
> So assuming that web browser clients calling the token endpoint will most
> likely be calling cross-origin, then it seems that client certificates
> won’t be sent anyway unless Access-Control-Allow-Credentials: true is
> returned from the preflight request. Given that calls to the token endpoint
> shouldn’t generally require cookies, then it seems likely that you can just
> *not* allow credentials in the CORS response and therefore not have any
> problem with prompting users for certificates. (Note that you can still
> manually set the Authorization header without ACAC set to true, you just
> have to whitelist that header in the AC-Allowed-Headers response).
>
> I haven’t got time to test it myself right now, but if so that seems like
> it side-steps the issue pretty neatly. Configure the token endpoint to ask
> for, but not require, client certs, and then make sure you don’t return
> Access-Control-Allow-Credentials: true on CORS preflight requests to that
> endpoint.
>
> — Neil
>
> > On 5 Feb 2019, at 15:21, Justin Richer <jricher@mit.edu> wrote:
> >
> > +1 to David. If it’s a redirect, 307 is more appropriate. It’s up to the
> AS to decide if the client should do MTLS or not, if there’s an option.
> >
> > — Justin
> >
> >> On Feb 4, 2019, at 12:17 PM, David Waite <david@alkaline-solutions.com>
> wrote:
> >>
> >> My understanding is that a permanent redirect would be telling the
> client (and any other clients getting cached results from an intermediary)
> to now stop using the original endpoint in perpetuity for all cases. I
> don’t think that is appropriate (in the general case) for an endpoint with
> request processing business logic behind it, since that logic may change
> over time.
> >>
> >> -DW
> >>
> >>> On Feb 4, 2019, at 6:28 AM, Brian Campbell <bcampbell=
> 40pingidentity.com@dmarc.ietf.org> wrote:
> >>>
> >>> Yeah, probably.
> >>>
> >>> On Sat, Feb 2, 2019 at 12:39 AM Neil Madden <neil.madden@forgerock.com>
> wrote:
> >>> If we go down the 307 route, shouldn’t it rather be a 308 (permanent)
> redirect? It seems unnecessary for the client to keep trying the original
> endpoint or have to remember cache-control/expires timeouts.
> >>>
> >>> — Neil
> >>
> >> _______________________________________________
> >> OAuth mailing list
> >> OAuth@ietf.org
> >> https://www.ietf.org/mailman/listinfo/oauth
> >
> > _______________________________________________
> > OAuth mailing list
> > OAuth@ietf.org
> > https://www.ietf.org/mailman/listinfo/oauth
>
>

-- 
_CONFIDENTIALITY NOTICE: This email may contain confidential and privileged 
material for the sole use of the intended recipient(s). Any review, use, 
distribution or disclosure by others is strictly prohibited.  If you have 
received this communication in error, please notify the sender immediately 
by e-mail and delete the message and any file attachments from your 
computer. Thank you._