Пример #1
0
        public ActionResult Index()
        {
            var sfAuth = new AuthModel()
            {
                IntegrationId        = "a6C2a0000004E7s",
                ConsumerKey          = "3MVG9dKFWsESbpkFgUzqLczaiM1zD2djiz2fQNCVM0bdG1GFNYx5R_aAzTDnfiF7npNYJ5m8KgWc..sWsMQZf",
                ConsumerSecret       = "1009989016979642666",
                Username             = "******",
                Password             = "******",
                SecurityToken        = "V6FNKl7RiJeqtvA3l4Li8khLB",
                TokenRequestPointUrl = "https://test.salesforce.com/services/oauth2/token"
            };

            _salesforce = new SalesForceDomain(sfAuth);
            return(View());
        }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="domain">Domain.</param>
        /// <param name="username">Username.</param>
        /// <param name="password">Password.</param>
        /// <param name="token">Token.</param>
        public SalesForceCredential(
            SalesForceDomain domain,
            string username,
            string password,
            string token)
        {
            if (String.IsNullOrWhiteSpace(username))
            {
                throw new ArgumentException("username is null or empty.");
            }

            Domain   = domain;
            Username = username.Trim().ToLower();
            Password = password;
            Token    = token;
        }