git-credential-manager
git-credential-manager copied to clipboard
Support generic OAuth for non-HTTP hosts
Non-HTTP hosts can support OAuth using absolute authorize/token endpoints, like EXO/Outlook.com SMTP. Example:
[sendemail]
smtpServer = smtp-mail.outlook.com
smtpUser = [email protected]
smtpEncryption = tls
smtpServerPort = 587
smtpAuth = XOAUTH2
[credential "smtp://smtp-mail.outlook.com:587"]
oauthClientId = a95fbac5-cbbb-4032-b10d-fb756c457ba1
oauthAuthorizeEndpoint = https://login.microsoftonline.com/common/oauth2/v2.0/authorize
oauthTokenEndpoint = https://login.microsoftonline.com/common/oauth2/v2.0/token
oauthScopes = offline_access https://outlook.office.com/SMTP.Send
This might need a docs update too. I'd like to include git send-email examples for Gmail/Outlook.com, but Git Bash doesn't ship with the required Authen-SASL version 2.1800 yet.
I also had to test this change on an alternate account. My [email protected] Outlook.com SMTP is broken on multiple clients, probably due to the grandfathered custom domain. Outlook support weren't helpful unfortunately.