[英]Salesforce OAuth Access_Token null?
我正在尝试实施以下salesforce网站链接中提供的其余api示例。
http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_REST_API
我已经按照链接中所述设置了项目,但是当我执行该项目时,出现错误,提示为“错误-无访问令牌”。 当我进行调试时,我知道变量accessToken为null。
字符串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);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.