Skip to main content

Auth0 Authorization Middleware for The Falcon Web Framework

Project description

Falcon Auth0 Authorization Middleware

Auth0 Authorization Middleware for The Falcon Web Framework

Install

Install through pip via

$ pip install falcon-auth0

Usage

You will need to supply a Dictionary containing Auth0 settings. These configurations can be supplied in two different ways. For the average user, you can supply a Dictionary of String keys and String values, such as:

cfg = {
    'alg': ['RS256'],
    'audience': 'my.app.name.auth0.com/userinfo',
    'domain': 'my.app.name.auth0.com', # or 'https://my.app.name.auth0.com/'
    'jwks_uri': 'https://my.app.name.auth0.com/.well-known/jwks.json'
}

If your application has multiple environments (Development, Test, QA, User Acceptance, Production), you may supply a Dictionary of String environment keys and Dictionary values of String keys with String Values, such as:

cfg = {
    'dev': {
        'alg': ['RS256'],
        'audience': 'my.dev.environment.auth0.com/userinfo',
        'domain': 'my.dev.environment.auth0.com', # or 'https://my.dev.environment.auth0.com/'
        'jwks_uri': 'https://my.dev.environment.auth0.com/.well-known/jwks.json'
    },
    'test': {
        'alg': ['RS256'],
        'audience': 'my.test.environment.auth0.com/userinfo',
        'domain': 'my.test.environment.auth0.com', # or 'https://my.test.environment.auth0.com/'
        'jwks_uri': 'https://my.test.environment.auth0.com/.well-known/jwks.json'
    },
    'uat': {
        'alg': ['RS256'],
        'audience': 'my.uat.environment.auth0.com/userinfo',
        'domain': 'my.uat.environment.auth0.com', # or 'https://my.uat.environment.auth0.com/'
        'jwks_uri': 'https://my.uat.environment.auth0.com/.well-known/jwks.json'
    },
    'prod': {
        'alg': ['RS256'],
        'audience': 'my.prod.environment.auth0.com/userinfo',
        'domain': 'my.prod.environment.auth0.com', # or 'https://my.prod.environment.auth0.com/'
        'jwks_uri': 'https://my.prod.environment.auth0.com/.well-known/jwks.json'
    }
}

Once complete, you'll inject the middleware directly into Falcon's falcon.API([...,Auth0Middleware(cfg),...]).

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

falcon_auth0-1.0.9.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

falcon_auth0-1.0.9-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file falcon_auth0-1.0.9.tar.gz.

File metadata

File hashes

Hashes for falcon_auth0-1.0.9.tar.gz
Algorithm Hash digest
SHA256 38eefd7b5c1b7646b6aacb7850d63e5441850fb665cefaa4924b0bf0fda9d912
MD5 12318d6d41a3e45943d93a8548027767
BLAKE2b-256 6d21fd32976f07f1ef85f9e50e9181c0842b4cd4bf5edae8b01d6efe225e6b7b

See more details on using hashes here.

File details

Details for the file falcon_auth0-1.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for falcon_auth0-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 671c94afc93b7f30372e98801c324c0c467c0347274e1c352f528bee142bd4e9
MD5 9b6f47ffa977ed37942134fe10c4a33f
BLAKE2b-256 40094416aaa9337795340bcf0812e78c122d078676ee3abf75cd498e14db2387

See more details on using hashes here.

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