Re: [OAUTH-WG] Correct error code for rate limiting?

David Waite <david@alkaline-solutions.com> Fri, 22 February 2019 07:09 UTC

Return-Path: <david@alkaline-solutions.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 2DB18130E58 for <oauth@ietfa.amsl.com>; Thu, 21 Feb 2019 23:09:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.435
X-Spam-Level: *
X-Spam-Status: No, score=1.435 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_SBL_CSS=3.335, SPF_PASS=-0.001] autolearn=no autolearn_force=no
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 O-RxtNZegJer for <oauth@ietfa.amsl.com>; Thu, 21 Feb 2019 23:09:12 -0800 (PST)
Received: from alkaline-solutions.com (lithium5.alkaline-solutions.com [IPv6:2600:3c00::f03c:91ff:fe93:6974]) by ietfa.amsl.com (Postfix) with ESMTP id C873012F1A5 for <oauth@ietf.org>; Thu, 21 Feb 2019 23:09:12 -0800 (PST)
Received: from [IPv6:2601:282:202:b210:219e:ff3b:9f20:9550] (unknown [IPv6:2601:282:202:b210:219e:ff3b:9f20:9550]) by alkaline-solutions.com (Postfix) with ESMTPSA id AC9C231694; Fri, 22 Feb 2019 07:09:10 +0000 (UTC)
From: David Waite <david@alkaline-solutions.com>
Message-Id: <9D2FC54D-176A-465A-8908-6D680763079C@alkaline-solutions.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_BBE552BB-F49B-4496-B699-60EA4099412E"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.2\))
Date: Fri, 22 Feb 2019 00:09:09 -0700
In-Reply-To: <CAGBSGjrrVbZhcnA8dNMp7xJnceGj8GzFJ-PeqQ6yFrOpgYjG5Q@mail.gmail.com>
Cc: OAuth WG <oauth@ietf.org>
To: Aaron Parecki <aaron@parecki.com>
References: <CAGBSGjrrVbZhcnA8dNMp7xJnceGj8GzFJ-PeqQ6yFrOpgYjG5Q@mail.gmail.com>
X-Mailer: Apple Mail (2.3445.104.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/BSqB9Juea1ctfF0_qZKR0ilsuCw>
Subject: Re: [OAUTH-WG] Correct error code for rate limiting?
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: Fri, 22 Feb 2019 07:09:14 -0000

I don’t believe that any of the currently registered error codes are appropriate for indicating that the password request is invalid, let alone a more specific behavior like rate limiting.

It is also my opinion that 400 Bad Request shouldn’t be used for known transient errors, but rather for malformed requests - the request could very well be correct (and have the correct password), but it is being rejected due to temporal limits placed on the client or network address/domain.

So I would propose a different statuses such 401 to indicate the username/password were invalid, and either 429 (Too many requests) or 403 (Forbidden) when rate limited or denied due to too many attempts. Thats not to say that the body of the response can’t be an OAuth-format JSON error, possibly with a standardized code - but again I don’t think the currently registered codes would be appropriate for conveying that.

That said, I don’t know what interest there would be in standardizing such codes, considering the existing recommendations against using this grant type.

-DW

> On Feb 21, 2019, at 10:57 PM, Aaron Parecki <aaron@parecki.com> wrote:
> 
> The OAuth password grant section mentions taking appropriate measures to rate limit password requests at the token endpoint. However the error responses section (
> https://tools.ietf.org/html/rfc6749#section-5.2 <https://tools.ietf.org/html/rfc6749#section-5.2>) doesn't mention an error code to use if the request is being rate limited.. What's the recommended practice here? Thanks!
> 
> Aaron
> 
> -- 
> ----
> Aaron Parecki
> aaronparecki.com <http://aaronparecki.com/>
> @aaronpk <http://twitter.com/aaronpk>
> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth