git-credential-manager icon indicating copy to clipboard operation
git-credential-manager copied to clipboard

Support generic OAuth for non-HTTP hosts

Open pl4nty opened this issue 5 months ago • 1 comments

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

pl4nty avatar Jun 14 '25 11:06 pl4nty

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.

pl4nty avatar Jun 14 '25 11:06 pl4nty

LICENSE.txt

NIGLOBAL avatar Jul 06 '25 05:07 NIGLOBAL