mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-05-19 10:25:26 +00:00
Fix MSGraph UsernamePassword Authentication (#497)
parsedmarc/pull/471 broke UsernamePassword authentication for me. This change fixes it. Co-authored-by: Tim Nowaczyk <tnowaczyk@eqx-kibana-1.allpointsbroadband.net>
This commit is contained in:
@@ -662,6 +662,11 @@ def _main():
|
||||
else:
|
||||
logger.critical("password setting missing from the "
|
||||
"msgraph config section")
|
||||
if "client_secret" in graph_config:
|
||||
opts.graph_client_secret = graph_config["client_secret"]
|
||||
else:
|
||||
logger.critical("client_secret setting missing from the "
|
||||
"msgraph config section")
|
||||
exit(-1)
|
||||
|
||||
if opts.graph_auth_method == AuthMethod.DeviceCode.name:
|
||||
|
||||
@@ -59,6 +59,7 @@ def _generate_credential(auth_method: str, token_path: Path, **kwargs):
|
||||
elif auth_method == AuthMethod.UsernamePassword.name:
|
||||
credential = UsernamePasswordCredential(
|
||||
client_id=kwargs['client_id'],
|
||||
client_credential=kwargs['client_secret'],
|
||||
disable_automatic_authentication=True,
|
||||
username=kwargs['username'],
|
||||
password=kwargs['password'],
|
||||
|
||||
Reference in New Issue
Block a user