sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dart:http www-authenticate multiple challenges syntax

Open giann opened this issue 4 years ago • 0 comments

Dart SDK version: 2.13.3 (stable) (Wed Jun 9 12:44:44 2021 +0200) on "macos_x64"

dart:http seems to not allow multiple comma separated challenges in the www-authenticate header:

www-authenticate: first-challenge param="value", second-challenge param2="value"
HttpException (HttpException: Failed to parse header value)

But RFC 7235 suggests its the correct syntax:

User agents are advised to take special care in parsing the field value, as it might contain more than one challenge, and each challenge can contain a comma-separated list of authentication parameters. Furthermore, the header field itself can occur multiple times.

For instance:

WWW-Authenticate: Newauth realm="apps", type=1, title="Login to "apps"", Basic realm="simple"

giann avatar Jul 19 '21 13:07 giann