Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow OAuth authentication #46

Open
valentinomariotto opened this issue Jun 17, 2024 · 1 comment
Open

allow OAuth authentication #46

valentinomariotto opened this issue Jun 17, 2024 · 1 comment

Comments

@valentinomariotto
Copy link

valentinomariotto commented Jun 17, 2024

Hi,
thank you for this exporter! I'd like for it to support OAuth authentication, for use with Microsoft 365 mailboxes.
It'd be great to be able to autheticate with an API key.
Thanks again

@jgosmann
Copy link
Owner

Noting down some relevant documentation and thoughts:

I think, the client grant credentials flow should be appropriate here. I suppose, dmarc-metrics-exporter would use that flow (which is basically one HTTP request) to obtain a access token (and refresh it when expired) and than uses that within the IMAP login step. (Maybe it should check the IMAP capabilities beforehand.)

Apart from the implementation, I wonder how to test this. I don't have a Microsoft 365 mailbox where I could configure a service principal of a client credentials grant flow. Maybe I can setup something temporarily, but not permanently as it is a paid service. This, however, still doesn't cover automated tests. Maybe I could setup a container with a Keycloak or similar for testing the client credentials flow, but not sure how to test the actual IMAP login ... I don't think Greenmail (my current test server) does support OAuth ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants