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.
If the certificate lives in an env var or a secret manager, pass its content
instead: CentralAuth.from_string(os.environ["CENTRAL_APP_ENTRY_CERT_JSON"]).
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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| central_auth-0.1.2.tar.gz | 7.2 kB | Without provenance | Details for central_auth-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| central_auth-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for central_auth-0.1.2-py3-none-any.whl |
Total release size: 14.7 kB
Release files / central_auth-0.1.2.tar.gz
| Download URL | central_auth-0.1.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a846c3e251366244d3efdea6264bd0e53959c7a7cf93bee1d967e274e340f59
|
|
BLAKE2b-256 checksum How to use checksums |
a6724e4949c86b7ae8b69e102d083843fa11e98b10139b501124512b6d85ef0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / central_auth-0.1.2-py3-none-any.whl
| Download URL | central_auth-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5df603609405d8b6f3857170e093c02d7f13d22deb0dbe8ff7cd87b23af80c8c
|
|
BLAKE2b-256 checksum How to use checksums |
9a91c34da1419eb584e0abafcd15ff42308cb883625977738439789883ed87e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for central-auth 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.