How to use the oauthenticator.OAuthLoginHandler function in oauthenticator

To help you get started, we’ve selected a few oauthenticator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyter-attic / jupyterhub-carina / jupyterhub_carina / CarinaAuthenticator.py View on Github external
from tornado.auth import OAuth2Mixin
from tornado import gen, web
from traitlets.config import LoggingConfigurable
from oauthenticator import OAuthLoginHandler, OAuthenticator
from .CarinaOAuthClient import CarinaOAuthClient


class CarinaLoginHandler(OAuthLoginHandler, OAuth2Mixin):
    """
    Carina OAuth dance magic
    """

    _OAUTH_AUTHORIZE_URL = CarinaOAuthClient.CARINA_AUTHORIZE_URL
    _OAUTH_ACCESS_TOKEN_URL = CarinaOAuthClient.CARINA_TOKEN_URL

    scope = ['identity', 'read', 'write', 'execute']


class CarinaAuthenticator(OAuthenticator, LoggingConfigurable):
    """
    Authenticate users with their Carina account
    """

    # Configure the base OAuthenticator