Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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")