How to use the adal.log.Logger function in adal

To help you get started, we’ve selected a few adal 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 AzureAD / azure-activedirectory-library-for-python / tests / util.py View on Github external
def create_empty_adal_object():
    context = log.create_log_context()
    component = 'TEST'
    logger = log.Logger(component, context)
    call_context = {'log_context' : context }
    adal_object = { 'log' : logger, 'call_context' : call_context }
    return adal_object
github AzureAD / azure-activedirectory-library-for-python / tests / test_log.py View on Github external
def test_logging(self):
        log_capture_string = StringIO()
        handler = logging.StreamHandler(log_capture_string)
        util.turn_on_logging(handler=handler)
        
        test_logger = adal_logging.Logger("TokenRequest", {'correlation_id':'12345'})
        test_logger.warn('a warning', log_stack_trace=True)
        log_contents = log_capture_string.getvalue()
        logging.getLogger(adal_logging.ADAL_LOGGER_NAME).removeHandler(handler)
        self.assertTrue('12345 - TokenRequest:a warning' in log_contents and 'Stack:' in log_contents)
github AzureAD / azure-activedirectory-library-for-python / adal / user_realm.py View on Github external
def __init__(self, call_context, user_principle, authority_url):

        self._log = log.Logger("UserRealm", call_context['log_context'])
        self._call_context = call_context
        self.api_version = '1.0'
        self.federation_protocol = None
        self.account_type = None
        self.federation_metadata_url = None
        self.federation_active_auth_url = None
        self._user_principle = user_principle
        self._authority_url = authority_url
github AzureAD / azure-activedirectory-library-for-python / adal / wstrust_response.py View on Github external
def __init__(self, call_context, response, wstrust_version):

        self._log = log.Logger("WSTrustResponse", call_context['log_context'])
        self._call_context = call_context
        self._response = response
        self._dom = None
        self._parents = None
        self.error_code = None
        self.fault_message = None
        self.token_type = None
        self.token = None
        self._wstrust_version = wstrust_version

        if response:
            self._log.debug(scrub_rstr_log_message(response))
github AzureAD / azure-activedirectory-library-for-python / adal / token_request.py View on Github external
def __init__(self, call_context, authentication_context, client_id, 
                 resource, redirect_uri=None):

        self._log = log.Logger("TokenRequest", call_context['log_context'])
        self._call_context = call_context

        self._authentication_context = authentication_context
        self._resource = resource
        self._client_id = client_id
        self._redirect_uri = redirect_uri

        self._cache_driver = None
        
        # should be set at the beginning of get_token
        # functions that have a user_id
        self._user_id = None
        self._user_realm = None

        # should be set when acquire token using device flow
        self._polling_client = None

adal

Note: This library is already replaced by MSAL Python, available here: https://pypi.org/project/msal/ .ADAL Python remains available here as a legacy. The ADAL for Python library makes it easy for python application to authenticate to Azure Active Directory (AAD) in order to access AAD protected web resources.

MIT
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages