Skip to content

Commit 669e4f7

Browse files
committed
SC-5308: extract upstream auth guide
1 parent 8559d98 commit 669e4f7

File tree

3 files changed

+48
-26
lines changed

3 files changed

+48
-26
lines changed

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

Lines changed: 0 additions & 26 deletions
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).
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
id: upstream-auth
3+
title: Sauce Connect Proxy Upstream Authentication
4+
sidebar_label: Upstream Authentication
5+
---
6+
7+
Sauce Connect Proxy 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 Proxy 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 Proxy 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+
## Usage
19+
20+
To configure Sauce Connect Proxy to send credentials to an upstream server, use the following format:
21+
22+
```bash
23+
--auth host:port:username:password
24+
```
25+
26+
### Example
27+
28+
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:
29+
30+
```bash
31+
--auth mysite.com:80:awesometester:supersekrit
32+
```
33+
You can also use HTTPS (port `443`) or any other port that your upstream server is listening on.
34+
35+
### Multiple Hosts
36+
37+
You can provide the `--auth` flag multiple times to support multiple upstream hosts:
38+
39+
```bash
40+
--auth mysite.com:80:awesometester:supersekrit \
41+
--auth myothersite.com:443:awesometester:supersekrit \
42+
--auth mythirdsite.com:80:awesometester:supersekrit
43+
```
44+
45+
## Security Tip
46+
47+
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

Lines changed: 1 addition & 0 deletions
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)