Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- consumerkey = ConfigurationManager.AppSettings["Salesforce_consumerkey"];
- consumersecret = ConfigurationManager.AppSettings["Salesforce_consumersecret"];
- username = ConfigurationManager.AppSettings["Salesforce_user"];
- password = ConfigurationManager.AppSettings["Salesforce_password"];
- AuthenticationClient auth = null;
- Task t = null;
- try
- {
- //create auth client to retrieve token
- auth = new AuthenticationClient();
- //get back URL and token
- t = auth.UsernamePasswordAsync(consumerkey, consumersecret, username, password);
- t.Wait();
- }
- catch (Exception e)
- {
- throw new Exception("Fail to create SF authentication", e);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement