mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-27 09:42:16 +00:00
feat: added xoauth for smtp (#11239)
# Which Problems Are Solved - Some mail providers (e.g.: MS Exchange) have deprecated plain auth # How the Problems Are Solved Adds XOauth2 auth option to SMPT - SMTP config now can contain XOAuth2 auth config - Proto files are updated to have a oneof for configuration selection. Old fields for configuring plain auth are still available not to create a breaking change. These can be removed in the future. - Columns are added to the database to persist the config # Additional Changes none # Additional Context Replace this example with links to related issues, discussions, discord threads, or other sources with more context. Use the Closing #issue syntax for issues that are resolved with this PR. - Closes #8042 --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Tim Möhlmann <[email protected]>
This commit is contained in:
co-authored by
Copilot
Tim Möhlmann
parent
96bbd6a65c
commit
3fc0ef2506
@@ -520,6 +520,14 @@ func setupSMTPSettings(commands *Commands, validations *[]preparation.Validation
|
||||
if smtpConfig == nil {
|
||||
return
|
||||
}
|
||||
var username string
|
||||
var pwd []byte
|
||||
if smtpConfig.SMTP.PlainAuth != nil {
|
||||
username = smtpConfig.SMTP.PlainAuth.User
|
||||
if smtpConfig.SMTP.PlainAuth != nil {
|
||||
pwd = []byte(smtpConfig.SMTP.PlainAuth.Password)
|
||||
}
|
||||
}
|
||||
*validations = append(*validations,
|
||||
commands.prepareAddAndActivateSMTPConfig(
|
||||
instanceAgg,
|
||||
@@ -528,8 +536,8 @@ func setupSMTPSettings(commands *Commands, validations *[]preparation.Validation
|
||||
smtpConfig.FromName,
|
||||
smtpConfig.ReplyToAddress,
|
||||
smtpConfig.SMTP.Host,
|
||||
smtpConfig.SMTP.User,
|
||||
[]byte(smtpConfig.SMTP.Password),
|
||||
username,
|
||||
pwd,
|
||||
smtpConfig.Tls,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user