When i first authenticate with OAuth to Salesforce course i dont get back a refresh token , i just get back an access token. So if the token needs to be refreshed by using the following:
var client = new RestClient("https://myOrg.salesforce.com/services/oauth2/token");
var request = new RestRequest("", Method.POST);
request.AddParameter("refresh_token", {currentRefreshToken}, ParameterType.GetOrPost);
request.AddParameter("grant_type", "refresh_token", ParameterType.GetOrPost);
request.AddParameter("client_id", {clientId}, ParameterType.GetOrPost);
request.AddParameter("client_secret", {clientsecret}, ParameterType.GetOrPost);
var response = client.Execute(request);
The currentRefreshToken is NULL because i didnt receive any refresh token on the initial authentication response. The initial call to authenticate is
https://login.salesforce.com/services/oauth2/authorize? client_id={consumer_key}&
redirect_uri={callback_url}& response_type=code
and this doesnt give back a refreshtoken. How can i get an initial refresh token ?