コード例 #1
0
        // GET: /<controller>/
        public IActionResult Index(String id)
        {
            SalesforceTokenManager.AccessToken response = SalesforceTokenManager.getAccessToken(
                "client_id",
                "username").Result;

            //Debug.WriteLine("RESPONSE: ", response.access_token);
            ViewData["access_token"] = response.access_token;
            ViewData["id"]           = id;
            return(View());
        }
コード例 #2
0
        public AccountController(IOptions <AppSettings> appSettings, ILogger <AccountController> logger)
        {
            _appSettings = appSettings.Value;
            _logger      = logger;

            _sfdcTokenManager = SalesforceTokenManager.getAccessToken(
                _appSettings.Sfdc.Url,
                _appSettings.Sfdc.ClientId,
                _appSettings.Sfdc.ClientSecret,
                _appSettings.Sfdc.Username,
                _appSettings.Sfdc.Password).Result;

            _logger.LogInformation("Access Token: {0}", _sfdcTokenManager.access_token);
            _logger.LogInformation("Instance Url: {0}", _sfdcTokenManager.instance_url);
        }