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 22h
Merged PRs (30d)
9

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

Research direction

Start by tracing the existing authentication configuration under runtime.host.authentication and the dab configure command; the issue names no files or tests. Done means the ApiKey provider supports the shown header, configuration, role header, and CLI key entries, with coverage for these examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.