scitokens
SciToken reference implementation library
What it is and what it does
SciTokens is a reference implementation library for the SciTokens JWT token format, designed to provide a high-level, safe interface for creating and validating authorization tokens in scientific computing workflows. It wraps PyJWT and cryptography to handle the low-level details of token signing, serialization, and verification, letting you focus on defining authorization claims and validation logic.
The library separates token verification (checking cryptographic integrity and authenticity) from validation (checking whether claims satisfy your authorization requirements). You can generate tokens with arbitrary claims, serialize them to a standard JWT format, deserialize and verify tokens from external sources, and use the Enforcer class to test whether a token grants specific permissions—such as read/write access to particular file paths. It also includes utilities for creating demo tokens and a Flask decorator for protecting endpoints.
Use it for:
- Generate and sign authorization tokens in an OAuth2 workflow for scientific computing infrastructure
- Validate incoming tokens at a storage or compute service to enforce access control policies
- Test token-based authorization logic in development using the demo token generator
- Enforce path-based access control (e.g., read/write permissions on specific directories) using the Enforcer class
- Protect Flask endpoints with token-based authentication and scope validation
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements the SciTokens JSON Web Token (JWT) format for generating, validating, and enforcing authorization claims in scientific computing environments.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It is the reference implementation for SciTokens, making it the natural choice if you need to work with this token format in scientific computing environments. Install it if you are building or integrating with systems that use SciTokens for authorization.
Install
scitokens on PyPI
pip
pip install scitokensuv
uv add scitokenspoetry
poetry add scitokensInstalling scitokens
Before you install
Low friction installation with three stable runtime dependencies (cryptography, PyJWT, requests). Actively maintained with recent commits and no known vulnerabilities.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and private projects with minimal restrictions beyond attribution.
Quickstart
import scitokens
# Generate a new token
token = scitokens.SciToken()
token['read'] = '/ligo'
serialized = token.serialize()
# Deserialize and validate
token = scitokens.SciToken.deserialize(serialized)
val = scitokens.Validator()
val.add_validator('read', lambda v: v.startswith('/'))
val.validate(token)
Verify before relying
- Whether the demo token generator endpoint (demo.scitokens.org) is reliably available for production use
- Performance characteristics when validating large numbers of tokens concurrently
- Compatibility with Python versions beyond 3.10 (classifiers list 3.5–3.10 but current support is unclear)
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — cryptography, PyJWT, requests |
| Maintenance | actively maintained — 154 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 95,770/month — #13,250 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scitokens-1.9.7-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
igwn-auth-utilsDiscovers and deserializes X.509 credentials…
permissive · top 15,000 on PyPI
joseImplements JSON Web Signature (JWS) and JSON…
permissive · top 15,000 on PyPI
python-jwtGenerates and verifies JSON Web Tokens (JWTs)…
permissive · top 15,000 on PyPI
jwskateImplements the JOSE family of IETF standards…
permissive · top 5,000 on PyPI
PyJWTPyJWT encodes and decodes JSON Web Tokens (JWT)…
permissive · top 100 on PyPI
axioms-fastapiAdds OAuth2/OIDC JWT token validation and…
permissive · top 15,000 on PyPI
python-joseImplements JOSE (JSON Object Signing and…
permissive · top 1,000 on PyPI
okta-jwt-verifierVerifies JWT tokens issued by Okta, checking…
permissive · top 15,000 on PyPI
atlassian-jwt-authGenerates and verifies JWT tokens for Atlassian…
permissive · top 15,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI