Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify documentation around dapr-api-token #4050

Merged
merged 5 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion daprdocs/content/en/operations/security/api-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ kubectl rollout restart deployment/<deployment-name> --namespace <namespace-name

## Adding API token to client API invocations

Once token authentication is configured in Dapr, all clients invoking Dapr API will have to append the API token token to every request:
Once token authentication is configured in Dapr, all clients invoking Dapr API need to append the `dapr-api-token` token to every request.

> **Note:** The Dapr SDKs read the [DAPR_API_TOKEN]({{< ref environment >}}) environment variable and set it for you by default.

<img src="/images/tokens-auth.png" width=800 style="padding-bottom:15px;">

### HTTP

Expand Down
6 changes: 4 additions & 2 deletions daprdocs/content/en/operations/security/app-api-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ kubectl rollout restart deployment/<deployment-name> --namespace <namespace-name

## Authenticating requests from Dapr

Once app token authentication is configured in Dapr, all requests *coming from Dapr* include the token.
Once app token authentication is configured using the environment variable or Kubernetes secret `app-api-token`, the Dapr sidecar always includes the HTTP header/gRPC metadata `dapr-api-token: <token>` in the calls to the app. From the app side, ensure you are authenticating using the `dapr-api-token` value which uses the `app-api-token` you set to authenticate requests from Dapr.

<img src="/images/tokens-auth.png" width=800 style="padding-bottom:15px;">

### HTTP

In case of HTTP, in your code look for the HTTP header `dapr-api-token` in incoming requests:
In your code, look for the HTTP header `dapr-api-token` in incoming requests:

```text
dapr-api-token: <token>
Expand Down
Binary file added daprdocs/static/images/tokens-auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading