I'm using the following code in an attempt to use the Salesforce REST API, but it seems my sessions are expiring immediately:
var authenticationClient = new AuthenticationClient()
{
ApiVersion = "v39.0"
};
requestText = authenticationClient.ApiVersion + "/sobjects/account";
await authenticationClient.UsernamePasswordAsync(cliendID, clientSecret, username, password + securityToken, endpointURL);
var client = new RestClient("https://cs67.salesforce.com/services/data/v39.0");
var request = new RestRequest("/sobjects/account", Method.GET);
request.AddHeader("Authorization", "Bearer" + authenticationClient.AccessToken);
var response = client.Execute(request);
return response.Content;
I'm getting an access token, but when I execute the request, I get the error "Session expired or invalid."
When I check my sessions in Salesforce, I see that my sessions are expiring immediately :
This is the view under Setup -> Security -> Session Management. The headings for the three times are: "Created", "Updated", and "Valid Until."
I've gone into my session settings and my profile settings and set the session timeout value to 24 hours, the maximum value. Why do my sessions continue to expire immediately?