Skip to content

Catzilla/traefik-jwt-internal

Repository files navigation

traefik-jwt-internal

Generate JWT token for internal services

Configuration

Key Type Required Default Description
alg string HS256 Hash algorithm, currently supported HS256 and HS512
claims string Token claims JSON (parsed as Go template)
header.name string Authorization Header in which to write token
header.prefix string Bearer Header value prefix
secret string Signing secret, at least 32 characters long
ttl int64 120 Token expiry time in seconds

Claims examples

From header

{
    "sub": "{{ .Header.Get "X-User-Id" }}"
}

From JSON header

{
    {{ $header := .Header.Get "X-User" }}
    {{ $user := unmarshalJson $header }}
    "sub": "{{ $user.id }}"
}

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Languages