Signing keys
Add, rotate and delete the key pairs your backend signs user and service tokens with.
Your backend signs a short-lived token for each user with a signing key: a key pair, Ed25519 (EdDSA) or P-256 (ES256). Folkways keeps only the public key and checks every token's signature with it. Until a segment has a signing key, it refuses every signed token.
Manage keys on the segment's Signing keys tab. Owners and admins add and delete keys.
Add a key
- Choose Add key and enter a Key ID (
kid), e.g.backend-2026-12. Your backend puts it in each token's header. - Either:
- Generate a key pair. Pick Ed25519 (the default) or P-256. The Console shows the private key once, to copy or download. We never keep a copy.
- Use my own public key. Create the pair yourself, with OpenSSL,
ssh-keygen, your key management service or a JWT library, and paste only the public key: a PEM, a JWK, or anssh-ed25519line.
- Save. The key works within seconds.
Store the private key in your backend's secrets manager, never in an app or a repository. The segment's Connect tab shows how to load it in Node.js, Python and Go.
Rotate a key
Keys coexist, so rotation has no downtime:
- Add a new key with a new ID.
- Switch your backend to sign with it.
- Wait until tokens signed with the old key have expired (at most 15 minutes), then delete the old key.
Delete a key
Deleting a key ends every connection whose token it signed, and its tokens stop working. If a private key leaks, add a new key, switch your backend, and delete the leaked one at once.
Lost a private key?
We can't show a generated private key again. Generate a new pair, switch your backend to it, and delete the old key.
See Identities and tokens for what goes in a token, and Realtime API authentication for signing one in any language.