Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #124 from AzureAD/pii-switch
Browse files Browse the repository at this point in the history
AuthenticationContext(...) adds an enable_pii flag
  • Loading branch information
rayluo authored Mar 2, 2018
2 parents a9bacfb + 69e6826 commit f8fd8ef
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions adal/authentication_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AuthenticationContext(object):

def __init__(
self, authority, validate_authority=None, cache=None,
api_version='1.0', timeout=None):
api_version='1.0', timeout=None, enable_pii=False):
'''Creates a new AuthenticationContext object.
By default the authority will be checked against a list of known Azure
Expand All @@ -73,6 +73,8 @@ def __init__(
:param timeout: (optional) requests timeout. How long to wait for the server to send
data before giving up, as a float, or a `(connect timeout,
read timeout) <timeouts>` tuple.
:param enable_pii: (optional) Unless this is set to True,
there will be no Personally Identifiable Information (PII) written in log.
'''
self.authority = Authority(authority, validate_authority is None or validate_authority)
self._oauth2client = None
Expand All @@ -93,7 +95,8 @@ def __init__(
'options': GLOBAL_ADAL_OPTIONS,
'api_version': api_version,
'verify_ssl': None if env_value is None else not env_value, # mainly for tracing through proxy
'timeout':timeout
'timeout':timeout,
"enable_pii": enable_pii,
}
self._token_requests_with_user_code = {}
self.cache = cache or TokenCache()
Expand Down

0 comments on commit f8fd8ef

Please sign in to comment.