Skip to content

Clarify network events received for authentication attempts  #722

@juliandescottes

Description

@juliandescottes

Assuming the client listens to network events, consider a basic http authentication flow where the user first performs a request and then provides credentials (either manually via the prompt, or using interception+continueWithAuth).

At the moment in Firefox the user will receive the following events:

  • beforeRequestSent for original request
  • responseStarted for original request
  • authRequired for original request
  • beforeRequestSent for authentication request
  • responseStarted for authentication request
  • responseCompleted for original request
  • responseCompleted for authentication request

So we are getting two sets of network events, one for the original request and one for the authentication request. For now in Firefox those 2 requests have the exact same id.

Looking at the fetch spec, the authentication request is triggered from:

Set response to the result of running HTTP-network-or-cache fetch given fetchParams and true.

(step 14.4 of https://fetch.spec.whatwg.org/#http-network-or-cache-fetch)

So spec wise we are actually reusing the same request object, and we would get beforeRequestSent/responseStarted again for the same request id as the original request.
And still according to the spec we should only get a single responseCompleted event once the authentication is done.

Are we happy with that model, where we will get N beforeRequestSent/responseStarted/authRequired events for a single responseCompleted and a single request id? Or do we want to update the spec to have unique request ids and/or individual responseCompleted events.

@OrKoN Do you know how Chrome behaves in this scenario and which events it will emit?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions