I couldn’t find any solution, how to use OAuth with SOAP. So I had to rewrite the whole application to their new Web API ( docs.microsoft.com/…/query-data-web-api) . It took me a lot of time, but I think, it is the only solution right now. It is really inconvinient, that they are deprecated that authorization out of nowhere and didn’t provided a reasonable solution.