central-auth
Mints Central App Entry tokens: the JWT your backend signs so the chat knows who just opened it. Server side only.
Install
pip install central-auth
Python ≥ 3.9.
Use
from central_auth import CentralAuth
# The path to the certificate file you downloaded.
central = CentralAuth.from_file("./central-app-entry-<kid>.json")
token = central.mint_token(user_id, {"userName": user_name})
The certificate file is the one you download when you generate your business's App Entry certificate. Nothing in it is copied by hand.
user_id is the identity Central logs in, so it must come from your own session
and never from the request: whoever can choose it signs in as that person.
The token is valid for 300 seconds, which is the protocol ceiling — mint one per entry rather than caching it.
Try it
examples/mint_token.py mints one token so you can check a certificate without
editing anything — the path comes from the environment:
pip install -e .
CENTRAL_APP_ENTRY_CERT=./central-app-entry-<kid>.json python examples/mint_token.py
CENTRAL_USER_ID and CENTRAL_USER_NAME are optional.
License
Apache-2.0
Metadata
Release files for central-auth 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| central_auth-0.1.0.tar.gz | 7.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| central_auth-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.5 kB
Release files / central_auth-0.1.0.tar.gz
| Download URL | central_auth-0.1.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9dc6c9e8a4a7c6e39f7cb9f7f2777ea727258ecfe24f15eb7b68d5f0e763e6b
|
|
BLAKE2b-256 checksum How to use checksums |
978e1cf2da050ac1744aab374e2c303c0fd0e9a0a6a173407c022b3953118264
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / central_auth-0.1.0-py3-none-any.whl
| Download URL | central_auth-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f67bb4d2827ecc4ea5d4d1fc44d0df3550c775969082856e4a698f05200b4e7
|
|
BLAKE2b-256 checksum How to use checksums |
49c786420cc4528b6b486fd18caeb35532e831a611dc9c2f517453d3ec272e73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|