Metadata-Version: 2.1
Name: oauth2tools
Version: 0.8.4
Summary: A toolset for the most requirements dealing with OAuth2 and OpenID Connect.
Author: Andreas Rühl
Maintainer: Andreas Rühl
License: MIT
Project-URL: GitHub, https://github.com/aruehl/oauth2tools
Project-URL: Bug Tracker, https://github.com/aruehl/oauth2tools/issues
Keywords: OAuth2,OIDC,OpenID Connect,Tools,Helper
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: flask
Requires-Dist: requests
Requires-Dist: werkzeug

# OAuth2Tools

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

## 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:
        ...
