Tony Ou
11/24/2025, 9:14 AMAsk Inkeep
11/24/2025, 9:14 AMAsk Inkeep
11/24/2025, 9:14 AM<https://your-api.com/path/to/api/endpoint?token=<OPAL_CLIENT_JWT>>
The external API should then extract and validate this JWT using the OPAL public key .
Implementing Additional Verification
For your data source to verify the OPAL client token, you can implement validation similar to this Python example :
from opal_common.schemas.security import AccessTokenRequest, PeerType
from acalla.config import OPAL_SERVER_URL, OPAL_MASTER_TOKEN
...
async with aiohttp.ClientSession(headers={"Authorization": f"bearer {OPAL_MASTER_TOKEN}", **self._headers}) as session:
token_params = AccessTokenRequest(
type=PeerType.client,
ttl=timedelta(days=CLIENT_TOKEN_TTL_IN_DAYS) ,
claims={'permit_client_id': pdp.client_id},
) .json()
async with <http://session.post|session.post>(f"{OPAL_SERVER_URL}/token", data=token_params) as response:
data: dict = await response.json()
token = data.get("token", None)
Configuration Options
You can configure token behavior using these environment variables (2) :
• OPAL_CLIENT_TOKEN - The authentication token for the client
• OPAL_AUTH_JWT_AUDIENCE - Expected audience in JWT tokens
• OPAL_AUTH_JWT_ISSUER - Expected issuer in JWT tokens
Recommendations
1. *Use Custom Claims*: Add identifying claims to client tokens that your data source can verify (1)
2. *External Validation*: Configure your external data source to validate the OPAL client JWT on each fetch request
3. *HTTPS Only*: Never use non-HTTPS URLs for external_source_url to protect the JWT in transit
The WebSocket persistence issue you describe is a known architectural consideration. While the documentation doesn't provide a built-in solution for continuous token validation during an active WebSocket connection, implementing validation at the data source level provides an additional security layer.Ask Inkeep
11/24/2025, 9:15 AMOr Weis
11/24/2025, 10:18 AMTony Ou
11/25/2025, 5:17 AMpermit support automation2
11/25/2025, 5:17 AMAlon Boshi
11/25/2025, 8:24 AMAsk Inkeep
11/25/2025, 8:24 AMAsk Inkeep
11/25/2025, 8:24 AMopal-client obtain-token $OPAL_AUTH_MASTER_TOKEN --server-url=$YOUR_SERVERS_ADDRESS --type datasource
Or via REST API:
curl --request POST '<https://opal.yourdomain.com/token>' \
--header 'Authorization: Bearer MY_MASTER_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "datasource",
}'
When publishing data updates, you can include authentication credentials that will be passed to the data source :
opal-client publish-data-update $token --src-url <http://mybillingserver.com/users> -t users -t billing --src-config '{"headers":{"authorization":"bearer secret-token"}}'
This allows the data source itself to validate the credentials when OPAL clients fetch data. The architecture separates the Pub/Sub channel authentication from the data fetching authentication, which addresses part of your concern by enabling validation at the data source level.Ask Inkeep
11/25/2025, 8:24 AMOr Weis
11/25/2025, 8:38 AMOr Weis
11/25/2025, 8:45 AM