import msal from msal import PublicClientApplication APPLICATION_ID_KEY = os.getenv('APPLICATION_ID_KEY ') CLIENT_SECRET_KEY = os.getenv('CLIENT_SECRET_KEY ') authority_url = 'https://login.microsoftonline.com/consumers' base_url = 'https://graph.microsoft.com/v1.0/' endpoint = base_url + 'me' SCOPES = ['User.Read','User.Export.All'] # Authenticate with Auth Code client_instance = msal.ConfidentialClientApplication(client_id=APPLICATION_ID_KEY, client_credential=CLIENT_SECRET_KEY, authority_url=authority_url )