Crossauth.js
Crossauth is a package for authentication and authorization using username/password, LDAP and OAuth2. It has two components, each can be used without the other: server for the backend and client for the frontend. It is still under development and currently only the OAuth client part is implemented. Enough of the session manager exists to support the OAuth client, but without user login functionality (ie just anonymous sessions).
There is also a Typescript package at https://github.com/mbakereth/crossauthjs that provides identical functionality, plus frontend Javascript..
The intention is to make this Python version as fully-featured as the Typescript version. However, currently only the OAuth client and resource server functionality exist.
It is also intended to support multiple web frameworks. Currently only FastAPI is supported.
Package structure
Unlike the Typescript version, there is only one package here: pycrossauth. Within this, however, are several modules:
crossauth_backend
Web framework-independent code for the backend server.
crossauth_fastapi
FastAPI version of crossauth, making use of crossauth_backend.
Package dependencies
This package intends to be flexible regarding other packages that need to be present. As well as choosing between two popular web frameworks, you can choose between several database management systems
- Postgres
- Sqlite
- Prisma
Using this package
Pycrossuth is in PYPI. To use it,
pip install pycrossauth
Building this package
If you want to build Crossauth from source, clone it from https://github.com/mbakereth/pycrossauth, install create and activate a virtual environment, then do the following from the top-level directory in the repo:
pip install -r requirements.txt
pip install -r requirements-optional.txt
pip install -r requirements-dev-txt
bash build.sh
The Examples
The examples directory contains a number of examples to get you going.
They require an OAuth server to be running. Easiest way is to clone the Typescript version, https://github.com/mbakereth/crossauthjs, and run the Sveltekit OAuth server example from there.
fastapiclient
An example of an OAuth client - requesting an access token
fastapiresserver
An exsample of an OAuth reserver server - validating an access token and providing an API endpoint.
Metadata
Release files for pycrossauth 1.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 | |
|---|---|---|---|
| pycrossauth-1.1.0.tar.gz | 158.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pycrossauth-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 343.9 kB
Release files / pycrossauth-1.1.0.tar.gz
| Download URL | pycrossauth-1.1.0.tar.gz |
|---|---|
| Size | 158.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
903acc456d1c2b5c6cc8bb4bee40c0772edce5dc237a7a6de860e85608e9f839
|
|
BLAKE2b-256 checksum How to use checksums |
4d66434bd957ff179716c3a5b894640c223c8b0143a840e9ac7e74518b2bad41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / pycrossauth-1.1.0-py3-none-any.whl
| Download URL | pycrossauth-1.1.0-py3-none-any.whl |
|---|---|
| Size | 185.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fe843b01898e6ea75ee66cbfd0c212d0f02b3e488bd5eed10c4a49284c86265e
|
|
BLAKE2b-256 checksum How to use checksums |
23091b8859f1d04f9d49a912ab2f2b46b4893356816eb42f169301231040127e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|