Skip to content

[Feature] Support of multiple HTTP credentials for different origins #22013

Description

With feature #20464 it is possible to specify the origin of http credentials.

An idea of enhancement would be to allow providing multiple credentials for different origins.

For example if different username/password are needed on either server1.com or server2.com, we could specify an array of httpCredentials (username/password/origin):

await browser.newContext({httpCredentials: [
	{ username: 'user1', password: 'pass1', origin: 'https://server1.com' },
	{ username: 'user2', password: 'pass2', origin: 'https://server2.com' }
]);

To be discussed:

  1. backward compatibility creating context with non array httpCredentials
  2. new naming for array httpCredentials
  3. edge case when 1 httpCredentials does not have origin (what credentials to use for server.com ?):
await browser.newContext({httpCredentials: [
	{ username: 'user1', password: 'pass1' },
	{ username: 'user2', password: 'pass2', origin: 'https://server.com' }
]);
  1. edge case when 2 httpCredentials do not have origin (what credentials to use for server.com ?):
await browser.newContext({httpCredentials: [
	{ username: 'user1', password: 'pass1' },
	{ username: 'user2', password: 'pass2' }
]);
  1. edge case when 2 httpCredentials have the same origin (what credentials to use for server.com ?):
await browser.newContext({httpCredentials: [
	{ username: 'user1', password: 'pass1', origin: 'https://server.com' },
	{ username: 'user2', password: 'pass2', origin: 'https://server.com' }
]);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions