jonhoo / rust-imap

IMAP client library for Rust
Apache License 2.0
490 stars 84 forks source link

Any example for using this crate with Microsoft Office 365 oAuth2 provider #283

Open Lilit0x opened 9 months ago

Lilit0x commented 9 months ago

I am trying to implement a Microsoft Office oAuth2 provider using the template for Gmail Ouath2. Has anyone done this and could share an example in this repo.

rustworthy commented 6 months ago

Hey @Lilit0x!

Please see the associated PR #288 with an end-to-end example.

But generally speaking - no matter which authority and provider you are relying upon - as long as you've procured an access token, you just need to implement imap::Authenticator for a struct that holds your access token and - most likely - email address. And if you compare the implementations in gmail_oauth2 and outlook_oauth2 you will see that they are pretty much identical - the benefit of having a protocol :smiley:

Hopefully, that helps you solve your issue.