Skip to content

Commit

Permalink
add verify params
Browse files Browse the repository at this point in the history
  • Loading branch information
sfonteneau committed Nov 9, 2024
1 parent b86da2c commit a60e77a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AADInternals_python
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [2024-11-09]
- Add params verify, Useful when you have a firewall that performs SSL inspection, you can mention the firewall certificate in configuration file.

## [2024-10-31]
- Remove password and mail for login azure, switch to lib msal
- Replace DIY cache, by official cache in msal
Expand Down
4 changes: 3 additions & 1 deletion libsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ def __init__(self):
self.az = None
self.dict_az_user={}
self.dict_az_group={}
self.verify=True

def connect(self):
if not self.az:
self.az = AADInternals(proxies=self.proxiesconf,
use_cache=self.use_cache,
save_to_cache=self.save_to_cache,
tenant_id=self.tenant_id,
cache_file=self.cache_file)
cache_file=self.cache_file,
verify=self.verify)
self.tenant_id = self.az.tenant_id
self.az.get_token(scopes=["https://graph.windows.net/.default"])

Expand Down
10 changes: 10 additions & 0 deletions run_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ def run_sync(force=False,from_db=False):
else:
azure.proxiesconf = {}

if config.has_option('common', 'verify'):
if config.get('common', 'verify').lower() in ('true', '1'):
azure.verify = True
elif config.get('common', 'verify').lower() in ('false', '0'):
azure.verify = False
else:
azure.verify = config.get('common', 'verify')
else:
azure.verify = True

with open(os.path.join(azureconf.rsplit(os.sep,1)[0] ,'mapping.json'),'r') as f:
mapping = json.loads(f.read())

Expand Down

0 comments on commit a60e77a

Please sign in to comment.