First, I make a curl call using the following format...
curl -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=xxx" -d "client_secret=xxx" -d "username=xxx" -d "password=xxx"
This works fine for me. I get back a bearer token no problem.
Second, I make the same call using the C# REST client for Salesforce as described here...
I plugin the following values...
UsernamePasswordAsync("xxx", "xxx", "xxx", "xxx", "https://login.salesforce.com/services/oauth2/token").Wait();
...but when I plugin these sames variables for the C# REST client for Salesforce I get the error "invalid_grant", "authentication failure"
Any help would be greatly appreciated. FYI - My password format is password/Security token so that shouldn't be the problem?
Trying this from another angle...
I made the request (succesfully, again) using Postman. Pstman gives you examples for each language you're using so this came up for C#
var client = new RestClient("https://login.salesforce.com/services/oauth2/token");
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "xxx");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "grant_type=password&client_id=xxx&client_secret=xxx&username=xxx&password=xxx", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Anyway, tried that and no such luck. Got a "Bad Request" back from http. This totally sucks.