我正在尝试实现下面的 salesforce 站点链接中给出的其余 api 示例。
http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_REST_API
我已经按照链接中的说明设置了项目,但是当我执行该项目时,我收到错误“错误 - 无访问 token ”。当我进行调试时,我发现变量 accessToken 为 null。
String accessToken = (String) request.getSession().getAttribute("ACCESS_TOKEN");
我对这个问题有点困惑。
请在这方面帮助我。
最佳答案
您的代码中似乎缺少这部分:
// Set a session attribute so that other servlets can get the
// access token
request.getSession().setAttribute(ACCESS_TOKEN, accessToken);
// We also get the instance URL from the OAuth response, so set it
// in the session too
request.getSession().setAttribute(INSTANCE_URL, instanceUrl);
关于java - Salesforce OAuth Access_Token 为空?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9127064/