XOAUTH2 Authentication Mechanism for SMTP #1432
Open
+181
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With upcoming changes on cloud providers, SMTP will not be working with AgnosticAuthentication. I added configuration to enable XOAUTH2 authentication with the OAUTH2 client credentials flow. The AgnosticAuthentication will still be the default, and current configs will work the same (no breaking changes). With the following config, the XOAUTH2 authentication can be enabled:
EMAIL_SMTP_AUTH_MECHANISM=> Sets the authentication mechanism. Options:AGNOSTIC,XOAUTH2. Default:AGNOSTIC.EMAIL_SMTP_OAUTH_CLIENT_ID=> Client ID for the OAUTH2 client credentials flowEMAIL_SMTP_OAUTH_CLIENT_SECRET=> Client Secret for the OAUTH2 client credentials flowEMAIL_SMTP_OAUTH_TOKEN_URL=> Token Endpoint for OAUTH2 (IdP specific)EMAIL_SMTP_OAUTH_SCOPES=> Scopes to fetch for the tokenRight now, I haven't added any documentation yet. I'd like for the PR to be checked first and then finalize the PR with the documentation after all necessary changes have been made.
Feel free to suggest changes and ask questions if something's not clear!