Skip to main content

OAuth2Tools

A toolset for the most requirements dealing with OAuth2 and OpenID Connect.

Installation

You can download it from pypi.org or install it with pip

pip install oauth2tools

Samples

Building the URL for the authentication endpoint

from oauth2tools import OAuthTools

tools = OAuthTools(
    well_known_url="<url>",
    client_id="<cid>",
    client_secret="<secret>")
auth_url = tools.authorization_url(redirect_uri="<uri>")

Using the Browser in a CLI script for authentication

from oauth2tools import OAuth4CLI

o4c = OAuth4CLI(
    well_known_url="<url>",
    client_id="<cid>",
    client_secret="<secret>")
response = o4c.login()
access_token = response.get('access_token')

Validate an received token

from oauth2tools import jwt_helper

try:
    jwt_helper.validate_by_jwks(
        token="<jwt>",
        jwks_url="<jwks_url>",
        claims={"<claim_name>": "expected_value"})
except Exception as e:
    ...

Release files for oauth2tools 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oauth2tools 0.9.1
File Size Uploaded
oauth2tools-0.9.1.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oauth2tools 0.9.1
File Interpreter ABI Platform
oauth2tools-0.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / oauth2tools-0.9.1.tar.gz

Download URL oauth2tools-0.9.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a3525675decae544b360b0f5f0254ac16ec8047f67d834a0237e6944013b9763
BLAKE2b-256 checksum
How to use checksums
2d7723089f9a176c71268ab1cc6843adcfcba1e067d7b12aa434faf811e3d885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / oauth2tools-0.9.1-py3-none-any.whl

Download URL oauth2tools-0.9.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e89a56ef5262b3e5ef43be379e874a27ff9c02f0fed1f7a1f90359fe2aa93a91
BLAKE2b-256 checksum
How to use checksums
b3e3a0aef76b2c2b02066c48458ca5c4a29b659314f2f0d45fe6755be2cd12c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.9.1 This release

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.1

2 release files

0.6.2

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page