Using this solution I am getting the error: {"error":"unsupported_grant_type","error_description":"grant type not supported"}. Googling this returns virtually always the result that the content-type should be set to "application/x-www-form-urlencoded". You clearly do that in
I got this error when trying to auth against a scratch org but using the wrong "login" url (login.salesforce.com instead of test.salesforce.com).
So maybe you are using the wrong url?
Using this solution I am getting the error: {"error":"unsupported_grant_type","error_description":"grant type not supported"}. Googling this returns virtually always the result that the content-type should be set to "application/x-www-form-urlencoded". You clearly do that in
".. InitHttpRequest(req, accessToken); req.ContentType = (!isObject ? "application/x-www-form-urlencoded" : req.Accept)
so what am I missing here?