Comments (16)
please post executable code which I can use to reproduce the error and a
detailed
description of what failed (if possible, with a stack trace included).
Original comment by [email protected]
on 10 Mar 2010 at 4:15
from oauth-signpost.
I'm not writing any new code i'm just using the YahooConsumer servlet in
net.oauth.example.consumer.webapp package. attached here and i had configured
the
yahoo.consumerKey and yahoo.consumerSecret in consumer.properties file.
And the response is attached in OAuth Yahoo report.htm file.
Thanks
Original comment by [email protected]
on 11 Mar 2010 at 10:04
Attachments:
- [OAuth Yahoo - Error report.htm](https://storage.googleapis.com/google-code-attachments/oauth-signpost/issue-30/comment-2/OAuth Yahoo - Error report.htm)
- YahooConsumer.java
from oauth-signpost.
I don't get it. The reports you posted don't use Signpost, but the
implementation
from oauth.net.
What's the problem you have with Signpost?
Original comment by [email protected]
on 11 Mar 2010 at 11:27
from oauth-signpost.
sry it's my fault :(
here is the code
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import oauth.signpost.OAuth;
import oauth.signpost.OAuthConsumer;
import oauth.signpost.OAuthProvider;
import oauth.signpost.basic.DefaultOAuthConsumer;
import oauth.signpost.basic.DefaultOAuthProvider;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
import oauth.signpost.exception.OAuthNotAuthorizedException;
/**
*
* @author prog
*/
public class sign extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
methods.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
long time = System.currentTimeMillis();
String customerkey =
"dj0yJmk9bzdyOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWN
yZXQm
eD04YQ--";
String customersecret_sig = "fc6df323fd6534abca91c82e1faa6b850ade69df";
String request_token_url = "https://api.login.yahoo.com/oauth/v2/" +
"get_request_token"+ "&oauth_consumer_key="+customerkey+
"&oauth_signature="+customersecret_sig;
String auth_token_url =
"https://api.login.yahoo.com/oauth/v2/request_auth";
String access_token_url =
"https://api.login.yahoo.com/oauth/v2/get_token";
// create a new service provider object and configure it with
// the URLs which provide request tokens, access tokens, and
// the URL to which users are sent in order to grant permission
// to your application to access protected resources
OAuthProvider provider = new DefaultOAuthProvider(request_token_url,
access_token_url, auth_token_url);
// create a consumer object and configure it with the access
// token and token secret obtained from the service provider
OAuthConsumer consumer = new DefaultOAuthConsumer(customerkey,
customersecret_sig);
provider.setRequestHeader("Authorization", "oauth_consumer_key=\""+
customerkey+"\"");
provider.setRequestHeader("Authorization","oauth_signature=\""+
customersecret_sig+"\"");
provider.setRequestHeader("Authorization","oauth_signature_method=\""+
"plaintext"+"\"");
// fetches a request token from the service provider and builds
// a url based on AUTHORIZE_WEBSITE_URL and CALLBACK_URL to
// which your app must now send the user
String urls = provider.retrieveRequestToken(consumer, OAuth.OUT_OF_BAND);
out.println("eshta");
out.println(urls);
} catch (Exception ex) {
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet sign</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet sign at " + request.getContextPath () +
"</h1>");
out.println("<h7>Servlet sign at " + ex.getMessage() + "</h7>");
out.println("</body>");
out.println("</html>");
Logger.getLogger(sign.class.getName()).log(Level.SEVERE, null, ex);
}finally {
out.close();
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the
+ sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
and the response is :
Servlet sign at Communication with the service provider failed:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df?oauth_callback=oob
and the exception i got is :
oauth.signpost.exception.OAuthCommunicationException: Communication with the
service
provider failed:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df?oauth_callback=oob
at
oauth.signpost.basic.DefaultOAuthProvider.retrieveToken(DefaultOAuthProvider.jav
a:99)
at
oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.
java:
66)
at sign.processRequest(sign.java:73)
at sign.doGet(sign.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erCha
in.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:
206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.jav
a:390
)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erCha
in.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:
206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
91)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otoco
l.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df?oauth_callback=oob
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorI
mpl.j
ava:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorA
ccess
orImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1296)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnectio
n.jav
a:1290)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.jav
a:944
)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnect
ionIm
pl.java:234)
at
oauth.signpost.basic.DefaultOAuthProvider.retrieveToken(DefaultOAuthProvider.jav
a:77)
... 20 more
Caused by: java.io.FileNotFoundException:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df?oauth_callback=oob
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.jav
a:123
9)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnec
tionI
mpl.java:318)
at
oauth.signpost.basic.DefaultOAuthProvider.retrieveToken(DefaultOAuthProvider.jav
a:71)
Original comment by [email protected]
on 11 Mar 2010 at 12:42
from oauth-signpost.
Thanks.
That exception indicates that the connection with the service provider was
unsuccessful, not that authorization failed. It could be a 400, for instance,
indicating a bad request. I don't know the YAHOO API, maybe they expect
additional
query parameters to be set, or a realm parameter in the Authorization header.
Please turn to the YAHOO forums with this first, and come back if you're sure
that
it's a defect in Signpost. I simply don't have the time to investigate every
failed
connection with every single service provider out there.
I'm working on making these error messages more explicit though, so that
debugging
becomes easier.
Original comment by [email protected]
on 11 Mar 2010 at 1:16
from oauth-signpost.
Hi
Some providers give more detailed error information in the connection error
stream
(HttpURLConnection.getErrorStream()). A few of those throw an exception when an
error
occurs and you try to read HttpURLConnection.getInputStream(). In these cases
signpost swallows the actual error so it would be a nice idea to also get the
error
information from getErrorStream().
Just a thought
Regards
Nabeel Mukhtar
Original comment by nabeelmukhtar
on 12 Mar 2010 at 6:17
from oauth-signpost.
True. That problem was already raised elsewhere, and I'll look into it as part
of a
forthcoming release.
Original comment by [email protected]
on 12 Mar 2010 at 8:48
from oauth-signpost.
Hey guys,
could anyone take on of the example projects (from here:
http://github.com/kaeppler/signpost-examples/tree/master) and rewrite them with
YAHOO
credentials, and then tell me if it works? The examples already use the latest
1.2.1
snapshot build, which fixes many issues.
or just grab the latest snapshot build from this site and see if it fixes your
problem.
Original comment by [email protected]
on 12 Mar 2010 at 5:30
from oauth-signpost.
this is the result output:
Exception in thread "main"
oauth.signpost.exception.OAuthCommunicationException: Communication with the
service provider failed: Server
returned HTTP response code: 401 for URL:
https://api.login.yahoo.com/oauth/v2/get_token
at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:213)
at oauth.signpost.AbstractOAuthProvider.retrieveAccessToken(AbstractOAuthProvider.java:97)
at GoogleMain.main(GoogleMain.java:44)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL: https://api.login.yahoo.com/oauth/v2/get_token
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1296)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1290)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:944)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnectionResponseAdapter.java:18)
at oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvider.java:227)
at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:188)
... 2 more
Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL: https://api.login.yahoo.com/oauth/v2/get_token
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1241)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
at oauth.signpost.basic.HttpURLConnectionResponseAdapter.getStatusCode(HttpURLConnectionResponseAdapter.java:22)
at oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:177)
... 2 more
Java Result: 1
Original comment by [email protected]
on 17 Mar 2010 at 4:24
from oauth-signpost.
please re-test using 1.2.1.1. the 1.2.1 release broke callbacks; just want to
make
sure it's not the same problem.
Original comment by [email protected]
on 21 Mar 2010 at 1:33
from oauth-signpost.
i've got this exception.
oauth.signpost.exception.OAuthCommunicationException: Communication with the
service
provider failed:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df
at
oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:21
4)
at
oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.
java:
69)
at sign.processRequest(sign.java:73)
at sign.doGet(sign.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erCha
in.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:
206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.jav
a:390
)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erCha
in.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:
206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
91)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otoco
l.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorI
mpl.j
ava:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorA
ccess
orImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1296)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnectio
n.jav
a:1290)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.jav
a:944
)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnect
ionIm
pl.java:234)
at
oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnecti
onRes
ponseAdapter.java:18)
at
oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvi
der.j
ava:228)
at
oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:18
9)
... 20 more
Caused by: java.io.FileNotFoundException:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.jav
a:123
9)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnec
tionI
mpl.java:318)
at
oauth.signpost.basic.HttpURLConnectionResponseAdapter.getStatusCode(HttpURLConne
ction
ResponseAdapter.java:22)
at
oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:17
8)
... 20 more
Mar 24, 2010 4:47:27 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Mar 24, 2010 4:48:33 PM sign processRequest
SEVERE: null
oauth.signpost.exception.OAuthCommunicationException: Communication with the
service
provider failed:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df
at
oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:21
4)
at
oauth.signpost.AbstractOAuthProvider.retrieveRequestToken(AbstractOAuthProvider.
java:
69)
at sign.processRequest(sign.java:73)
at sign.doGet(sign.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erCha
in.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:
206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.jav
a:390
)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erCha
in.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:
206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
91)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otoco
l.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorI
mpl.j
ava:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorA
ccess
orImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1296)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnectio
n.jav
a:1290)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.jav
a:944
)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnect
ionIm
pl.java:234)
at
oauth.signpost.basic.HttpURLConnectionResponseAdapter.getContent(HttpURLConnecti
onRes
ponseAdapter.java:18)
at
oauth.signpost.AbstractOAuthProvider.handleUnexpectedResponse(AbstractOAuthProvi
der.j
ava:228)
at
oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:18
9)
... 20 more
Caused by: java.io.FileNotFoundException:
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0yJm
k9bzd
yOGdWbG9Lc2FNJmQ9WVdrOVR6RkdVRGxCTjJzbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD04YQ-
-
&oauth_signature=fc6df323fd6534abca91c82e1faa6b850ade69df
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.jav
a:123
9)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnec
tionI
mpl.java:318)
at
oauth.signpost.basic.HttpURLConnectionResponseAdapter.getStatusCode(HttpURLConne
ction
ResponseAdapter.java:22)
at
oauth.signpost.AbstractOAuthProvider.retrieveToken(AbstractOAuthProvider.java:17
8)
... 20 more
Original comment by [email protected]
on 24 Mar 2010 at 2:51
from oauth-signpost.
That usually means the request you're sending is ill-formed, e.g. because you're
missing a query parameter required by Yahoo.
Please print out the exception.getResponseBody() and post it here.
Original comment by [email protected]
on 24 Mar 2010 at 2:59
from oauth-signpost.
that was is the stack trace.
Original comment by [email protected]
on 25 Mar 2010 at 8:34
from oauth-signpost.
actually i tried much tools to use yahoo apis url and always give me 401 error,
i just
want to make sure that the this error from yahoo not from me.
Original comment by [email protected]
on 25 Mar 2010 at 8:37
from oauth-signpost.
I just skimmed through the error HTML again, and it says this:
"Custom port is not allowed or the host is not registered with this consumer
key."
Please turn to Yahoo with this problem, since this is not Signpost specific.
Either
you're sending requests over the wrong port number, or like it said, you're
sending
the request to a wrong endpoint (maybe Yahoo assigns consumers keys on a
per-domain
basis, but I simply don't know).
Original comment by [email protected]
on 25 Mar 2010 at 8:48
- Changed state: Invalid
from oauth-signpost.
The error "Custom port is not allowed or the host is not registered with this
consumer key." occurs when you use a different port other than 80 to hit yahoo
servers. Configure jetty to use Port 80 and let me know if it works.
Original comment by [email protected]
on 25 Mar 2010 at 6:06
from oauth-signpost.
Related Issues (20)
- Request: RSA-SHA1 Signing HOT 4
- retrieveRequestToken(consumer, null) fails with signpost 1.2.1.1 HOT 1
- retrieveRequestToken returns an error of 500 HOT 4
- POST support for DefaultOAuthConsumer HOT 1
- OAuthGoogleExample not executing HOT 2
- After Java upgrade: "Server returned HTTP response code: 411 for URL HOT 10
- For Android Twitter Usage HOT 3
- SignatureBaseString havent sort requestParameters
- Oauth java.lang.ClassNotFoundException: org.apache.http.HttpRequest
- Enhancement : adding license text in tarball
- didn't support HTTP GET method in this framework
- two-legged OAuth HOT 3
- Signing fails when multiple parameters with the same key are used HOT 1
- consumer key with special characters causes signpost to generate incorrect signature HOT 4
- Doesnt work on 3.2, tested on motorola xoom 3.2 HOT 5
- NULL exception after CommonsHttpOAuthProvider is de-serialized
- oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: null HOT 5
- incorrect get signing when params include space
- URL query parameter without values causes failure HOT 1
- oauth-signpost don't include the license file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oauth-signpost.