iagsdc / phpmailer_gmail_oauth2

Drupal 10 module designed as GMail Oauth2 plugin for PHPMailer SMTP module
GNU General Public License v3.0
0 stars 0 forks source link

Consider using Oauth2Client module #1

Closed FatherShawn closed 5 months ago

FatherShawn commented 5 months ago

Hi! I saw your post on drupal.org. I thought I'd bring Oauth2Client to your attention. It could simplify your code here quite a bit as it is a plugin based general Oauth2 client manager which handles all the Oauth2 interactions and token management. It's a developer module for creating custom plugins tailored to the Oauth2 configuration of an external system. It includes some example plugins.

It's designed to use any League AbstractProvider so I think it would easily offload good deal of your maintenance here.

iagsdc commented 5 months ago

Thanks for pointing that out. I’ll take a look.

On Apr 29, 2024, at 3:46 AM, Shawn Duncan @.***> wrote:

Hi! I saw your post on drupal.org https://www.drupal.org/project/smtp/issues/3102055#comment-15572801. I thought I'd bring Oauth2Client https://www.drupal.org/project/oauth2_clientto your attention. It could simplify your code here quite a bit as it is a plugin based general Oauth2 client manager which handles all the Oauth2 interactions and token management. It's a developer module for creating custom plugins tailored to the Oauth2 configuration of an external system. It includes some example plugins https://git.drupalcode.org/project/oauth2_client/-/tree/4.1.x/examples/oauth2_client_example_plugins?ref_type=heads.

It's designed to use any League AbstractProvider so I think it would easily offload good deal of your maintenance here.

— Reply to this email directly, view it on GitHub https://github.com/iagsdc/phpmailer_gmail_oauth2/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZAVF7XMMMPV3DBSIMOS4DY7YQJPAVCNFSM6AAAAABG6COJM2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DQNRZHA2TONA. You are receiving this because you are subscribed to this thread.

iagsdc commented 5 months ago

I've added a new repository (oauth2_client_gmail_plugin) containing a plugin designed to work with Oauth2Client. It still needs a README to document the setup; I'll add that in a day or two.

iagsdc commented 5 months ago

See repository iagsdc/oauth2_client_gmail_plugin.

iagsdc commented 5 months ago

Shawn,

You may have seen I filed a Feature Request on the Drupal OAuth2 Client page.

I can get a gmail OAuth2 Client plugin to work, but only if I store the gmail address inDescription. Various flavors of the OAuth2 Client form allow for username and password, but don’t store the values. Gmail address is needed every time an email is sent.

Fred

On Apr 29, 2024, at 3:46 AM, Shawn Duncan @.***> wrote:

Hi! I saw your post on drupal.org https://www.drupal.org/project/smtp/issues/3102055#comment-15572801. I thought I'd bring Oauth2Client https://www.drupal.org/project/oauth2_clientto your attention. It could simplify your code here quite a bit as it is a plugin based general Oauth2 client manager which handles all the Oauth2 interactions and token management. It's a developer module for creating custom plugins tailored to the Oauth2 configuration of an external system. It includes some example plugins https://git.drupalcode.org/project/oauth2_client/-/tree/4.1.x/examples/oauth2_client_example_plugins?ref_type=heads.

It's designed to use any League AbstractProvider so I think it would easily offload good deal of your maintenance here.

— Reply to this email directly, view it on GitHub https://github.com/iagsdc/phpmailer_gmail_oauth2/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZAVF7XMMMPV3DBSIMOS4DY7YQJPAVCNFSM6AAAAABG6COJM2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DQNRZHA2TONA. You are receiving this because you are subscribed to this thread.