Added auth plugin for Xoauth2#227
Conversation
Signed-off-by: Emery <emery@shopjimmy.com>
Signed-off-by: Emery <emery@shopjimmy.com>
Signed-off-by: Emery <emery@shopjimmy.com>
Signed-off-by: Emery <emery@shopjimmy.com>
|
This was a copy of AUTH PLAIN. Some of the checks are not passing for code that is already in the framework in same fashion in another file, but i've tried this on local and it works. |
Slamdunk
left a comment
There was a problem hiding this comment.
I see the Psalm errors are shared among all Auth classes, and you just copy-pasted most of the code.
I'm fine with this, but please update the psalm baseline to get the CI green
Co-authored-by: Filippo Tessarotto <zoeslam@gmail.com> Signed-off-by: Emery <emery@shopjimmy.com>
Co-authored-by: Filippo Tessarotto <zoeslam@gmail.com> Signed-off-by: Emery <emery@shopjimmy.com>
Signed-off-by: Emery <emery@shopjimmy.com>
Signed-off-by: Emery <emery@shopjimmy.com>
Signed-off-by: Emery <emery@shopjimmy.com>
Sorry about all that Signed-off-by: Emery <emery@shopjimmy.com>
|
Thank you @EmeryEx |
|
My bad, sorry. @EmeryEx would you be so kind to update https://github.com/laminas/laminas-mail/blob/2.22.x/docs/book/transport/smtp-authentication.md as well? |
|
Yes I will add doc section in the next week or so when I get some time. Thank you guys! |
|
Thanks for this @EmeryEx. Could you explain how to use it ? Where do I get the access token ? |
It's no easy task and unfortunately, it's something you need to implement yourself. But once you have the access token with the right permissions, you just have to supply it to SmtpTransport: Then your transport is ready to send mail. Here are the docs for Office365 on obtaining Access tokens and such: One more thing after you've acquired an access token, you still need to enable SMTP auth for the email account as an admin (one time) |
|
@EmeryEx |
Where exactly should i put it? Not sure the docs flow you've got going on |
|
@EmeryEx https://github.com/laminas/laminas-mail/blob/2.22.x/docs/book/transport/smtp-authentication.md |
Added auth plugin for Xoauth2
|
Hi @EmeryEx, Is this working? Please share the documentation on how to use it? |
Yes
So you can connect to services like Microsoft Office 365 and utilize SMTP that doesn't support legacy protocols
Xoauth2 auth protocol for SMTP
via the Laminas\Mail\Protocol\SmtpPluginManager as "xoauth2" or by "connection_class" option as "xoauth2" on SmtpOptions fed into SmtpTransport in a factory
I'm sorry i don't see a develop branch. I'm new to this.