Achim Schön
Achim Schön

Reputation: 75

SMTP for Office 365 with OAuth 2 by libcurl - how to get bearer token without registering application for client_id and client_secret

I've already written a couple of applications for REST calls which are authenticated by OAuth2 and therefor I had to register the application to get the client_id and client_secret in order to request the bearer token.

Now I'm facing the task to extend an existing SMTP functionality which is build on libcurl for using smtp.office365.com with enabled OAuth 2. cURL provides this functionality by the option CURLOPT_XOAUTH2_BEARER (see: https://curl.se/libcurl/c/CURLOPT_XOAUTH2_BEARER.html) and I found some information how to register an application in an Azure account which allows to request the bearer token. However I wonder how a mail client like Thunderbird is able to use this, without being registered for the specif account. Do they have an internal client_id / client_secret registered which is valid for all office365 accounts or are they following another protocol?

Upvotes: 0

Views: 53

Answers (0)

Related Questions