# Temporal JWT token authentication

DevFeed: [Temporal JWT token authentication](<https://devfeed.tech/articles/temporal-jwt-token-authentication-102710.md>)

Original publisher: [Read original article](<https://temporal.io/blog/temporal-jwt-token-authentication>)

Author: Adam Quan

Published: 2026-10-27T00:00:00Z

Content type: article

Language: en

Sources: [Temporal](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [JSON Web Tokens](<https://devfeed.tech/topics/jwt.md>), [Keycloak](<https://devfeed.tech/topics/keycloak.md>), [Authentication](<https://devfeed.tech/topics/authentication.md>), [Access Control](<https://devfeed.tech/topics/access-control.md>), [Single sign-on (SSO)](<https://devfeed.tech/topics/sso.md>), [Secure token management](<https://devfeed.tech/topics/secure-token-management.md>), [OpenID connect (OIDC)](<https://devfeed.tech/topics/oidc.md>), [gRPC](<https://devfeed.tech/topics/grpc.md>), [client library](<https://devfeed.tech/topics/client-library.md>)

Tags: [authentication](<https://devfeed.tech/tags/authentication.md>), [configure](<https://devfeed.tech/tags/configure.md>), [jwt](<https://devfeed.tech/tags/jwt.md>), [keycloak](<https://devfeed.tech/tags/keycloak.md>), [mapping](<https://devfeed.tech/tags/mapping.md>), [refresh](<https://devfeed.tech/tags/refresh.md>), [self-hosted](<https://devfeed.tech/tags/self-hosted.md>), [sso](<https://devfeed.tech/tags/sso.md>), [temporal](<https://devfeed.tech/tags/temporal.md>), [temporal-voices](<https://devfeed.tech/tags/temporal-voices.md>), [token](<https://devfeed.tech/tags/token.md>), [token-authentication](<https://devfeed.tech/tags/token-authentication.md>), [worker](<https://devfeed.tech/tags/worker.md>)

## AI overview

The article outlines JWT authentication for self-hosted Temporal using Keycloak. It assigns machine clients such as Workers a client-credentials flow and human UI or CLI users an interactive login, with Keycloak roles mapped to Temporal's `permissions` claim (for example, `temporal-system:admin`). Temporal's default ClaimMapper reads those claims and its Authorizer checks permissions; the frontend needs JWT verification keys, while the internal frontend remains available for internal cluster traffic. The UI is configured with Keycloak discovery, client credentials, callback URL, and scopes. CLI requests pass a bearer token through `TEMPORAL_GRPC_META_AUTHORIZATION`; SDK clients pass it in `rpc_metadata`. Since tokens expire, the Python example refreshes them in the background by updating client metadata before expiry, avoiding a token request on every API call. The demonstration omits TLS, so tokens sent over the network are vulnerable to interception.

## Source excerpt

Learn how to configure JWT authentication for self-hosted Temporal with Keycloak, including SSO, Worker access, role mapping, and token refresh.