function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Syed Abid ShahSyed Abid Shah 

Unable to receive refresh token from my code from salesforce Applciation

Hi Folks,

We are unable to receive Refresh token with below code, earlier it was working fine but not sure what is the root cause for it.
Please share your inputs on this:

await authenticationClient.UsernamePasswordAsync(
                       SFService.GetAppSetting("Salesforce:ConsumerKey"),
                       SFService.GetAppSetting("Salesforce:ConsumerSecret"),
                       SFService.GetAppSetting("Salesforce:Username"),
                       SFService.GetAppSetting("Salesforce:Password") + SFService.GetAppSetting("Salesforce:SecurityToken", true),
                       SFService.GetAppSetting("Salesforce:Domain") + "/services/oauth2/token");
 
                    salesforceToken = new SalesforceToken(authenticationClient);
 
                }
 
 
 
  public SalesforceToken(AuthenticationClient authenticationClient)
            {
                if (authenticationClient == null)
                {
                    throw new ArgumentNullException("authenticationClient");
                }
 
                this.AccessToken = authenticationClient.AccessToken;
                this.RefreshToken = authenticationClient.RefreshToken;
                this.InstanceUrl = authenticationClient.InstanceUrl;
                this.ApiVersion = authenticationClient.ApiVersion;
            }

 
Santosh Reddy MaddhuriSantosh Reddy Maddhuri
Check  Setup -->  Email Administration --> Deliverability --> Access to Send Email (All Email Services) --> Access leve --> All email or not in your instance.