Skip to main content

A convenience libary of OAuth2.0 providers

Project description


A Python package offering convenient methods for OAuth2.0 authentication

Currently only Google OAuth2.0 has been implemented

Expects a config object passed into the class on instantiation of the Authicola class.

Scopes are accepted as arguments by the config, but they can also be passed in as a kwarg on the Authicola class method for the driver or a method on the driver itself.


    'google': {
        'client_id': os.environ.get('GOOGLE_CLIENT'),
        'client_secret': os.environ.get('GOOGLE_SECRET'),
        'redirect_uri': os.environ.get('GOOGLE_REDIRECT'),
        'scopes': ['profile', 'email']
    'github': {
        'client_id': os.environ.get('GITHUB_CLIENT'),
        'client_secret': os.environ.get('GITHUB_SECRET'),
        'redirect_uri': os.environ.get('GITHUB_REDIRECT'),
        'scopes': ['read:user', 'public_repo']

from authicola import Authicola

a = Authicola(DRIVERS)

# default scope from config used
authorization_url = a.driver('google').redirect_uri()

# only email scope requested as kwarg, overrides config for driver
authorization_url = a.driver('google', scopes=['email']).redirect_uri()

# only profile and email scopes requested manually, this time as method on the driver class, overrides config for driver
authorization_url = a.driver('google').scope('email', 'profile').redirect_uri()

On callback from the authentication provider, a params dict is expected for parsing to retrieve the user.


# callack endpoint

a = Authicola(DRIVERS)

params = request.GET

user = a.driver('google').user(params)
    'id': <id>,
    'email': '',
    'verified_email': True,
    'name': 'Gary Burgmann',
    'given_name': 'Gary',
    'family_name': 'Burgmann',
    'picture': '<pic-url>',
    'locale': 'en-GB'

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

authicola-0.0.3.tar.gz (2.8 kB view hashes)

Uploaded Source

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