Skip to content

Commit 13c7342

Browse files
authored
SC-5308: extract upstream auth guide (#3179)
1 parent 8cf844c commit 13c7342

File tree

3 files changed

+62
-26
lines changed

3 files changed

+62
-26
lines changed

docs/secure-connections/sauce-connect-5/advanced/security-authentication.md

-26
Original file line numberDiff line numberDiff line change
@@ -83,32 +83,6 @@ Having our own cloud enables us to provide our services faster, and with higher
8383

8484
For an overview of the services offered by Sauce Labs, our methods for securing the transmission of test data and results, and our security policies and procedures, see our white paper, [Overview of Sauce Labs Security Processes](https://saucelabs.com/resources/white-papers/overview-of-sauce-labs-security-processes).
8585

86-
## Authentication Using `--auth`
87-
88-
This approach to authentication works by configuring Sauce Connect Proxy to send authentication details to any URL requesting them. It works for all requests, even those where you're asked for credentials in response to a click or form submission.
89-
90-
For each URL where you need to bypass HTTP authentication, add this to your Sauce Connect Proxy startup command:
91-
92-
```bash
93-
--auth host:port:username:password
94-
```
95-
96-
If your website doesn't need a port, you can use the default port, `port 80`. Let's say that your website under test is `mysite.com`, your username is `awesometester`, and your password is `supersekrit`. Here's how you'd write your Sauce Connect Proxy startup command:
97-
98-
```bash
99-
--auth mysite.com:80:awesometester:supersekrit
100-
```
101-
102-
You can use this option multiple times in a row:
103-
104-
```bash
105-
--auth mysite.com:80:awesometester:supersekrit \
106-
--auth myothersite.com:443:awesometester:supersekrit \
107-
--auth mythirdsite.com:80:awesometester:supersekrit
108-
```
109-
110-
For more information, see [Using Environment Variables for Authentication Credentials](/basics/environment-variables).
111-
11286
## Certificate Handling
11387

11488
The security of Sauce Connect Proxy communication to both the Sauce Labs API and the virtual machine hosting your tests in the Sauce Labs cloud is managed through [public key certificates](https://en.wikipedia.org/wiki/Public_key_certificate).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
id: upstream-auth
3+
title: Sauce Connect Upstream Authentication
4+
sidebar_label: Upstream Authentication
5+
---
6+
7+
Sauce Connect supports upstream HTTP authentication via the [`--auth`](/dev/cli/sauce-connect-5/run/#auth) flag.
8+
This flag allows the proxy to automatically send credentials to specified hosts.
9+
It is necessary when your site under test is protected by basic authentication, and you want Sauce Connect to handle authentication transparently for you.
10+
11+
## Overview
12+
13+
By using the [`--auth`](/dev/cli/sauce-connect-5/run/#auth) flag, you can instruct Sauce Connect to send authentication credentials automatically whenever a request matches a specific host and port. This works for:
14+
15+
- Standard HTTP basic authentication prompts.
16+
- Authentication challenges triggered by clicks or form submissions.
17+
18+
:::note
19+
All domains specified via the [`--auth`](/dev/cli/sauce-connect-5/run/#auth) flag are automatically [resigned](https://docs.saucelabs.com/secure-connections/sauce-connect-5/advanced/security-authentication/#ssl-certificate-bumping), as if they were passed using the [`--tls-resign-domains`](/dev/cli/sauce-connect-5/run/#tls-resign-domains) flag.
20+
:::
21+
22+
## Usage
23+
24+
To configure Sauce Connect to send credentials to an upstream server, use the following format:
25+
26+
```bash
27+
--auth <username[:password]@host:port,...>
28+
```
29+
30+
### Example
31+
32+
If your application is hosted at `mysite.com` and uses basic authentication with the username `awesometester` and password `supersekrit`, your command would look like this:
33+
34+
```bash
35+
--auth awesometester:[email protected]:80
36+
```
37+
You can also use HTTPS (port `443`) or any other port that your upstream server is listening on.
38+
39+
### Multiple Hosts
40+
41+
You can provide the `--auth` flag multiple times to support multiple upstream hosts:
42+
43+
```bash
44+
--auth awesometester:[email protected]:80 \
45+
--auth awesometester:[email protected]:443 \
46+
--auth awesometester:[email protected]:80
47+
```
48+
49+
### Wildcard Matching
50+
51+
You can use asterisks (*) to match any host and/or any port:
52+
53+
```bash
54+
--auth awesometester:supersekrit@*:*
55+
```
56+
57+
This instructs Sauce Connect to send the credentials to all hosts and all ports it connects to.
58+
59+
## Security Tip
60+
61+
If you're concerned about exposing credentials in the command line (where they can be viewed in process lists), consider using environment variables instead. For more details, see [Using Environment Variables](/secure-connections/sauce-connect-5/guides/configuration/#environment-variables)

sidebars.js

+1
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,7 @@ module.exports = {
10391039
'secure-connections/sauce-connect-5/guides/ci-cd-integration',
10401040
'secure-connections/sauce-connect-5/guides/tunnel-pool',
10411041
'secure-connections/sauce-connect-5/guides/sharing-tunnel',
1042+
'secure-connections/sauce-connect-5/guides/upstream-auth',
10421043
],
10431044
},
10441045
{

0 commit comments

Comments
 (0)