python-adfs
Python module for interacting with Microsoft ADFS and OIDC for authentication and authorization, simplified, type-safe and production-ready.
Installation
Install the module using pip
pip install pyadfs
See pyproject.toml for more information and changelog.md for updates.
Usage
It is recommended that you read the microsoft docs for foundational knowledge on ADFS authentication.
See microsoft docs and OWASP regarding ADFS best practices.
all methods have matching async functions and classes for use in async environments.
from pyadfs import ADFSClient, TokenModel, generate_token
raw_token = generate_token(
grant_type="password",
username="didi45R@example.local",
password="top-secret",
)
client = ADFSClient() # Use env variables or pass vars directly at init (see config.py)
token_model = client.validate_token(raw_token.access_token)
upn = token_model.user_principle_name
email = token_model.email_address
print(f"{upn}'s token expires at: {token_model.exp_readable_timestamp}")
Useful links
- jwt.io (jwt playground)
- JWT RFC7519
- microsoft example openid-configuration
Created by Yedidya.R
Copyright © Yedidya Rosenstark. All rights reserved.
Metadata
Release files for python-adfs 1.0.1
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 |
|---|---|---|---|---|
| python_adfs-1.0.1.tar.gz | 14.7 kB | Without provenance | Details for python_adfs-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_adfs-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for python_adfs-1.0.1-py3-none-any.whl |
Total release size: 34.0 kB
Release files / python_adfs-1.0.1.tar.gz
| Download URL | python_adfs-1.0.1.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99f7e2b7db0b5ef4b11db63879d7232398b4724645a70fefd7ea3bbdaa78a316
|
|
BLAKE2b-256 checksum How to use checksums |
52100c74c70ac175b384a71485d23576981075cd2f216ad534069453b8dbf31a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / python_adfs-1.0.1-py3-none-any.whl
| Download URL | python_adfs-1.0.1-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e31915015beb8d130b617a4c4a23d7447d3d44dd1cd8e5759f47f18a740cb8bc
|
|
BLAKE2b-256 checksum How to use checksums |
3b57cd13f143f738714456819fb0b176ee5245cc7063bd4383999e54b3dfe944
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Security for python-adfs 1.0.1
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.