jonhoo / rust-imap

IMAP client library for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Lilit0x opened this issue · comments

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.

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 😃

Hopefully, that helps you solve your issue.