Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取oauth_问题:Java中的签名_无效错误_Java_Oauth_Signature - Fatal编程技术网

获取oauth_问题:Java中的签名_无效错误

获取oauth_问题:Java中的签名_无效错误,java,oauth,signature,Java,Oauth,Signature,运行我的第一个OAuth提供者/使用者示例 我的提供者是运行在Tomcat7上的以下jsp <%@page import="net.oauth.*, net.oauth.server.*" %> <% String consumerSecret="testsecret"; String consumerKey="testkey"; OAuthMessage message=OAuthServlet.getMessage(request,null); OAuth

运行我的第一个OAuth提供者/使用者示例

我的提供者是运行在Tomcat7上的以下jsp

<%@page import="net.oauth.*, net.oauth.server.*" %>
<%
  String consumerSecret="testsecret";
  String consumerKey="testkey";

  OAuthMessage message=OAuthServlet.getMessage(request,null);
  OAuthConsumer consumer=new OAuthConsumer(null, consumerKey, consumerSecret, null);
  OAuthAccessor accessor=new OAuthAccessor(consumer);

  SimpleOAuthValidator validator=new SimpleOAuthValidator();
  validator.validateMessage(message,accessor);

  System.out.println("It must have worked"); 
%>
}`

当我运行客户端时,我从提供者那里得到这个错误响应

oauth_signature: onPnFrUtighWHU0UrERD0Wg7mII=
oauth_签名基础字符串:GET&http%3A%2F%2localhost%3A9080%2OAuthTest%2OAuthTest.jsp&oauth_使用者密钥%3Dtestkey%26oauth_nonce%3D2098667235%26oauth_签名方法%3DHMAC-SHA1%26oauth_时间戳%3D1317506767%26oauth_令牌%3Dtestkey%26oauth_版本%3D1.0

oauth_问题:签名_无效

oauth_签名_方法:HMAC-SHA1 net.oauth.signature.OAuthSignatureMethod.validate(OAuthSignatureMethod.java:69) net.oauth.SimpleAuthValidator.validateSignature(SimpleAuthValidator.java:254) net.oauth.SimpleAuthValidator.validateMessage(SimpleAuthValidator.java:148) org.apache.jsp.oauthttest\u jsp.\u jsp服务(oauthttest\u jsp.java:75) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javaservlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333) javaservlet.http.HttpServlet.service(HttpServlet.java:722)


任何指示都将不胜感激。thx

我也有同样的问题。你修好了吗?
oauth_signature: onPnFrUtighWHU0UrERD0Wg7mII=