How to use the oauthenticator.azureadb2c.AzureAdB2CMixin 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 jupyterhub / oauthenticator / oauthenticator / azureadb2c.py View on Github external
def azure_token_url():
    return os.environ.get('OAUTH_ACCESS_TOKEN_URL', '') 


def azure_authorize_url():
    return os.environ.get('OAUTH_AUTHORIZE_URL', '') + '&scope=' + quote(os.environ.get('OAUTH_SCOPE', ''))


class AzureAdB2CMixin(OAuth2Mixin):
    _OAUTH_ACCESS_TOKEN_URL = azure_token_url() 
    _OAUTH_AUTHORIZE_URL = azure_authorize_url()
    

class AzureAdB2CLoginHandler(OAuthLoginHandler, AzureAdB2CMixin):
    pass


class AzureAdB2COAuthenticator(OAuthenticator):
    login_service = Unicode(
               os.environ.get('AAD_LOGIN_SERVICE_NAME', 'Azure AD B2C'),
                config=True,
                help="Tenant")

    login_handler = AzureAdB2CLoginHandler

    username_claim = Unicode(
               os.environ.get('AAD_USERNAME_CLAIM', 'upn'),
                config=True,
                help="Tenant")