Skip to main content

A Python package to deal with OAuth PKCE authentication flow to generate JWT tokens from desktop apps.

Project description

Python PKCE Client

This python package contains a simple client to request tokens using the OAuth 2/OIDC Authorization Code PKCE flow.

Sample usage

from terevintosoftware.pkce_client import PkceClient, PkceLoginConfig

config = PkceLoginConfig(
    authorization_uri="https://localhost:44300/connect/authorize",
    token_uri="https://localhost:44300/connect/token",
    scopes=[ "openid", "profile", "api" ],
    client_id="python-nb",
    internal_port=8888,
    add_random_state=True,
    random_state_length=32,
    verify_authorization_server_https=False
)

login_client = PkceClient(config)
pkce_token = login_client.login()
headers = { "Authorization": "Bearer " + str(pkce_token.access_token) }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TerevintoSoftware.PkceClient-0.0.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page