Azure / Azure/data-api-builder

[Enh]: New auth provider `ApiKey`

Open
#3,540 0 comments 0 reactions 0 assignees View on GitHub
2.x auth
Dominant language
C#
Stars
1.5k
Forks
370
Avg merge
3d 17h
Merged PRs (30d)
8

Description

## Header syntax

```http
GET /api/Book
X-API-Key: super-secret-value
X-MS-API-ROLE: api-client
```
## Configuration

```json
"authentication": {
"provider": "ApiKey",
"api-key": {
"header": "X-API-Key",
"keys": [
{
"name": "internal-service-a",
"key": "@env('DAB_SERVICE_A_API_KEY')",
"roles": [ "service-a" ]
},
{
"name": "internal-service-b",
"key": "@env('DAB_SERVICE_B_API_KEY')",
"roles": [ "service-b" ]
}
]
}
}
```

## Command line

```bash
dab configure --runtime.host.authentication.api-key.keys "internal-service-a:@env('DAB_SERVICE_A_API_KEY'):service-a"
dab configure --runtime.host.authentication.api-key.keys "internal-service-b:@env('DAB_SERVICE_B_API_KEY'):service-b"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.