Skip to content

Commit

Permalink
chore: Update readme with multiple topics in JWT (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikornaselur committed Apr 2, 2024
1 parent b120327 commit b16bd47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -51,7 +51,7 @@ Notiflux uses an EC256 public/private key pair JWT for authentication. Notiflux
is deployed with the public key, while the broadcaster has the private key as a
secret.

When clients connect, they need to provide a JWT with the topic and scope,
When clients connect, they need to provide a JWT with the topics and scope,
signed by the private key. This token should be provided be the broadcasting
source.

Expand All @@ -67,12 +67,15 @@ The JWT token needs to have the following payload:
"sub": "notiflux", // Can be any value
"exp": 123, // Expiry just needs to be valid for the broadcast
// or subscribe event, so just few seconds is enough
"topic": "topic", // The topic to validate against
"topics": ["topic"], // The topics to validate against
"scope": "subscribe|broadcast", // Needs to be either 'subscribe' for clients
// or 'broadcast' for broadcaster
}
```

Note that the topics can be a list of just one topic or multiple topics, which
means the same JWT can be used to subscribe or broadcast to multiple topics.

See ./scripts folder for examples in Python

## Deployment
Expand Down

0 comments on commit b16bd47

Please sign in to comment.