当前位置:网站首页>salesforce使用方法(salesforce authenticator下载)
salesforce使用方法(salesforce authenticator下载)
2022-07-30 10:31:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
//获取Salesforce Token
public String getSalesforceToken()
{
String getTokenUrl = 'https://login.salesforce.com/services/oauth2/token';
String grant_type = 'password';
String username = 'XXXXXX';
String password = 'XXXXXX';
String client_id = 'XXXXXXX';
String client_secret = 'XXXXXX';
//获取token的链接和请求参数
String endpoint = getTokenUrl + '?' + 'grant_type=' + grant_type + '&client_id=' + client_id + '&client_secret=' + client_secret + '&username=' + username + '&password=' + password;
HttpRequest req = new HttpRequest();
system.debug('Endpoint is : ' + endpoint);
req.setEndpoint(endpoint);
req.setMethod('POST');
//发送http请求
Http http = new Http();
HTTPResponse res = http.send(req);
String result = res.getBody();
system.debug('result is : ' + result);
if(String.isNotEmpty(result)) {
return result;
}
return null;
}发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/129628.html原文链接:https://javaforall.cn
边栏推荐
猜你喜欢

spark udf 接受并处理 null值.

加密和安全

MFCC转音频,效果不要太逗>V<!

梅科尔工作室-看鸿蒙设备开发实战笔记七——网络应用开发

STM32CubeMX configuration to generate FreeRTOS project

关于verilog的时延研究

Multithreading--the usage of threads and thread pools

梅科尔工作室-看鸿蒙设备开发实战笔记四——内核开发

The configuration process and related syntax of writing markdown format notes in vscode
Container Technology - A Simple Understanding of Kubernetes Objects
随机推荐
自适应控制——仿真实验一 用李雅普诺夫稳定性理论设计自适应规律
ESP32CAM 1838接收红外遥控器信号
Redis Desktop Manager 2022.4.2 released
WARN: Establishing SSL connection without server's identity verification is not recommended when connecting to mysql
Meikle Studio-Look at Hongmeng Device Development Practical Notes 7-Network Application Development
PyQt5 - Drawing different types of straight lines
[Deep Learning] (Problem Record)
- Linear Regression - Small Batch Stochastic Gradient Descent 安全提示:Qt中的FreeType
【Flume】batchSize和transactionCapacity区别
Log4j有哪几种日志级别呢?
PyQt5 - draw text on window
@RequestBody 和 @ResponseBody 详解
线程池方式开启线程--submit()和execute()的区别
OC-关于alloc和dealloc(还没开始写)
In 2022, the top will be accepted cca shut the list
360 released a future-oriented EDR to protect the security of government and enterprise user terminals in an all-round way
MySQL installation tutorial [installation version]
正则表达式快速入门笔记
(***Key points***) Flink common memory problems and tuning guide (1)
JCL learning