diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index 08da40f..60d9206 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -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: diff --git a/parsedmarc/mail/graph.py b/parsedmarc/mail/graph.py index f2fe299..2fc4364 100644 --- a/parsedmarc/mail/graph.py +++ b/parsedmarc/mail/graph.py @@ -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'],