Skip to content

Commit

Permalink
document upstream basic authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffy-mathew committed Oct 11, 2024
1 parent de98886 commit c8718c7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Upstream Basic Authentication
tags: ["upstream-basic-auth"]
description: "How to authenticate upstream requests with basic authentication"
menu:
main:
parent: "Upstream Authentication"
weight: 2
---

If your upstream API is protected with basic authentication, you can configure Tyk to send requests with basic authentication credentials.

- You can specifiy username and password to be used.
- You can configure the header in which basic authenticaiton credentials are to be sent, the default header to be used is `Authorization`.


## How To Set Up

### Via API Definition

Inside your OAS API definition you should configure `x-tyk-api-gateway.upstream.authentication.basicAuth` field.
- `enabled` needs to be true to enable upstream basic authentication.
- `headerName` is the header to be used.
- `username` is the username to be used.
- `password` is the password to be used.

```
{{< note success >}}
**Note**
`x-tyk-api-gateway.upstream.authentication.enabled` needs to be true to enable upstream authentication.
If the configured `headerName` is also sent from clientside, Tyk will replace it with basic auth credentials before sending it to upstream.
{{< /note >}}
```
8 changes: 8 additions & 0 deletions tyk-docs/data/menu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,14 @@ menu:
path: /basic-config-and-security/security/authentication-authorization/json-web-tokens/jwt-keycloak
category: Page
show: True
- title: "Upstream Authentication"
category: Directory
show: True
menu:
- title: "Upstream basic authentication"
path: /basic-config-and-security/security/upstream-authentication/basic-authentication
category: Page
show: True
- title: "MTLS"
category: Directory
show: True
Expand Down

0 comments on commit c8718c7

Please sign in to comment.