Re: [Wish] Authentication for resource url

Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com> Tue, 14 September 2021 07:51 UTC

Return-Path: <sergio.garcia.murillo@gmail.com>
X-Original-To: wish@ietfa.amsl.com
Delivered-To: wish@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EDEE53A0AE4 for <wish@ietfa.amsl.com>; Tue, 14 Sep 2021 00:51:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 1z10a1kCYOGb for <wish@ietfa.amsl.com>; Tue, 14 Sep 2021 00:51:30 -0700 (PDT)
Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (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 EC61B3A0ABA for <wish@ietf.org>; Tue, 14 Sep 2021 00:51:29 -0700 (PDT)
Received: by mail-pf1-x431.google.com with SMTP id j6so11073542pfa.4 for <wish@ietf.org>; Tue, 14 Sep 2021 00:51:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sKHZa3UP6G2ERu9wICGJwEjJiW83wHmdePl0SGtQlac=; b=EZwlC0R0nzpOksO0AmB5RCGl1j4/5TPlBTCXsw6YGKc9ktRmlCoJiOpq+nNOTRNlwP e786IhmbmseI90hI2+S9sS42dqm3EMv8aUY/7O5+KqbmMKqTi9r0iiLOnbDOzz57F5BX k80Mhw+69nrxY+GuM3QTqdMAT+BqS9AbuaSTVNM6EckQJ5MW+/akcBEc2foCHkTG/fP+ ato2SDr8vSndnF3XhTf2L8s0ake/ttyG7kY+Jj1ySLBC7TozFPdyWrjj/8UfkLVDn1AV IYKdhVDF/RI6ocUQoXsIy3SI2VmfSBbMmSIKdxFAC80hhTKEcYJU6rBFYsBydgFbodla 2+7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sKHZa3UP6G2ERu9wICGJwEjJiW83wHmdePl0SGtQlac=; b=rAyP6Ki92nQONtRQh7rEx1ISq59UWI7DQmPnCOIOYHxbCfb6RQJxuttnQQqK5OssQn AE8Ou6oGAaTt72L/ITaf6p6FT1852rw6+Gq3w/C6c0Ibl1gYOmGc+7kXQmQtuhkQeIqg UgXBWchlIQgkqI0bIvwIyoH5NuJYgRKBT1bLum6cpqxzHYuRfQx/+Iz6hN6O62aQrykH SjqcxgHVNqaBXX5gkmGDdfh26fbmXIausyARBPp62VOiANSA3BTrwt1k37rpa8E7jOT3 g5zOY+p3qGHR+/NbnPH0B1xga1LjO7se6jEObo1YEyXA0eqXpfK6asA/mIfvgCqBISYj HEGQ==
X-Gm-Message-State: AOAM53102vO+/1ZURufjpe4Co/7HKvG1UySCz2RNA1YRSs0hcD/ll4wd G53IZGqCwhGag5OWNtWhZ5UnhhVJiq1+w7EqXrtmAHWksOw=
X-Google-Smtp-Source: ABdhPJxiarMexrd0GIp/SKig2gJOCkF0fqtGhfFznWrM9dPSqFFPU7mjHu7VwCLR+ovII8IUCSZvCvMbOOan3cV0kZ0=
X-Received: by 2002:a62:8fc3:0:b0:405:473a:7461 with SMTP id n186-20020a628fc3000000b00405473a7461mr3457697pfd.28.1631605887271; Tue, 14 Sep 2021 00:51:27 -0700 (PDT)
MIME-Version: 1.0
References: <CA+ag07bjtS1Ucw1BZ5qQ_jJFfXbfQ3-hzDgxfkV1APhV1JZMnQ@mail.gmail.com> <87o893vuz4.wl-jch@irif.fr> <CA+ag07Y41bg_K-60=d5yyODj+bN442enQn-Grb-NkX7zQ8vVBQ@mail.gmail.com> <1e55c847-6a6c-5fca-d7c0-cd3a822855a7@nostrum.com> <CA+ag07YZdQooVBLtn=R=Lj0XpojCmVzd51P6=ExFUqwhvqYNdA@mail.gmail.com> <28d39165-3d08-257e-4736-1c8449e99034@nostrum.com> <CAABnt0NxfyTBQmGkh3gU69bf0zDok_pm5+Lun62EABha0gEATQ@mail.gmail.com> <66b34dab-7a67-656e-d619-c5109ca99bbb@nostrum.com> <87ee9sfo63.wl-jch@irif.fr> <CA+ag07Y5Lduu=923bLpp_PC_NLiwpLCiEdfbCN-H3tDD8LnT3A@mail.gmail.com> <CAABnt0M2Vg-9=SwX=O1mFbyYTS4b7ewmevW2qzMf17fsagoc2Q@mail.gmail.com> <CA+ag07aJKFy2s_UD0L-PaGHNwA9XH6Khz+0tReOMMcweJ0Q0hQ@mail.gmail.com> <CAABnt0MSUuxYK1CvOQUmC-a4b_U9m7YQ+vhXfjaaDxFZE+_JOQ@mail.gmail.com> <CA+ag07bb5WfoUJRkQt37nYtkmtEi=Kpp44ihVNGRd=OytakADg@mail.gmail.com> <CAABnt0PXKPejtywBDizx_Og0d0qPp6qa6cXXsCjBrbTQHN9pKg@mail.gmail.com> <CAMyc9bXUXR5nrxoQsQwDqE46sHWN_8vicG_c53ZruRbC0gfeMw@mail.gmail.com> <877dfk9fil.wl-jch@irif.fr>
In-Reply-To: <877dfk9fil.wl-jch@irif.fr>
From: Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com>
Date: Tue, 14 Sep 2021 09:51:15 +0200
Message-ID: <CA+ag07ZxJF95xd7y_ToRRNJmbRboRR56t=mnW+nGYFqpAkH61g@mail.gmail.com>
To: Juliusz Chroboczek <jch@irif.fr>
Cc: Cameron Elliott <cameron@cameronelliott.com>, Matt Ward <mattward@mux.com>, Adam Roach <adam@nostrum.com>, WISH List <wish@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000530e1105cbefd9f1"
Archived-At: <https://mailarchive.ietf.org/arch/msg/wish/DpyBuVZjBMiRqdqY8KTtgTgmkYY>
Subject: Re: [Wish] Authentication for resource url
X-BeenThere: wish@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: WebRTC Ingest Signaling over HTTPS <wish.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/wish>, <mailto:wish-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/wish/>
List-Post: <mailto:wish@ietf.org>
List-Help: <mailto:wish-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/wish>, <mailto:wish-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Sep 2021 07:51:46 -0000

El mar, 14 sept 2021 a las 2:18, Juliusz Chroboczek (<jch@irif.fr>)
escribió:

> > 1. concrete example comparing how it can be used as an alternative to
> > username/password. (http basic auth alternative)
>
> It's not about giving an example, it's about giving a normative way of
> using username/password with WHIP.
>
> For better or worse, Galene uses username/password for authentication, as
> does every other videoconference server known to me.  If a user know the
> group URL and their username/password, they can use Galene.  I want them
> to be able to access Galene over WHIP, and while I'm happy to write extra
> code (which needs only be done once), I don't want to do any extra
> per-user setup (which needs to be done once per user).
>
> If there is a normative way of using bearer tokens with password auth,
> then please give us the RFC number so we can implement it.  If there is
> none, then I suggest we make HTTP Basic mandatory to implement in clients.
>
>
Using an username and password for authentication is very limited and for
sure does not cover all the use cases for whip. Maybe on your
implementation that username and password was just used for the
conferencing solution, so a simple solution works for you.

However there are a lot of cases when a username and password is clearly
inefficient and not fit for the job:

- Using third party authentication: many web pages allows to log in using
external account (google, facebook, github), in this case you may not even
have an username and password for that account, or are you going to ask
someone to introduce their google mail and password in you encoder to be
able to stream it?.
- The account is used for much more than just the streaming service and
they would allow you to log into your service and perform a lot of
operations on your behalf. Would you be comfortable giving your credentials
to an external only service that could be hacked and your password exposed
in the wild?
- Most of the time the streaming service is not used by a single person,
each person having a unique login but sharing the account, which
credentials would you use in that case?

That's why most rest apis are using token authentication instead of just
using the username/password for the service. Even more, for example
github does not even allow you to use your username and password anymore on
git clients with ssh but you have to create an app token as secret in order
to prevent your account from being compromised if that info is leaked.

The actual value and format of the token is completely service specific and
we don't need to specify it. As a service provider you have a wide range of
options:


   - Generate a unique random token, associate it to a stream/account on
   your service and persist it on db or similar, then use a generic url
   /whip/endpoint for all the requests and retrieve the stream info associated
   with the bearer token from the db.
   - Generate a signed jwt containing the stream/account information which
   does not require to be persisted on the db,  then use a generic url
   /whip/endpoint for all the requests and extract the stream info from the
   jwt once the signature is validated
   - A variation of this would be to put the token on the url itself
   /whip/endpoint?token=${token} and not use a bearer token at all
   - Generate a custom token (like base64(${username}:${password})),  then
   use a generic url /whip/endpoint for all the requests and extract the
   stream info from the token. [insecure]
   - Put the username in the url /whip/endpoint/${username} and use the
   password as token [insecure]
   - use oath2, 2fa,...

Best regards
Sergio