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:
- backward compatibility creating context with non array httpCredentials
- new naming for array httpCredentials
- 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' }
]);
- 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' }
]);
- 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' }
]);
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):
To be discussed: