JBesaw29 / oauth-signpost

Automatically exported from code.google.com/p/oauth-signpost
0 stars 0 forks source link

not working with yahoo #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.trying to authorize with yahoo apis it replies with the service provider 
failed: 
https://api.login.yahoo.com/oauth/v2/get_request_token&oauth_consumer_key=dj0
yJmk9Rmt6SWVnMlFzTTZuJmQ9WVdrOU4yVlhjbmxoTm5NbWNHbzlOalV6TnpRME5qSS0mcz1jb25z
dW1lcnNlY3JldCZ4PTEz&oauth_signature=883723e79b1dd7affe3ea0389c3a391634fab160
?oauth_callback=oob

Original issue reported on code.google.com by gemy2...@gmail.com on 1 Mar 2010 at 6:16

GoogleCodeExporter commented 8 years ago
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 m.kaepp...@gmail.com on 10 Mar 2010 at 4:15

GoogleCodeExporter commented 8 years ago
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 gemy2...@gmail.com on 11 Mar 2010 at 10:04

Attachments:

GoogleCodeExporter commented 8 years ago
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 m.kaepp...@gmail.com on 11 Mar 2010 at 11:27

GoogleCodeExporter commented 8 years ago
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 gemy2...@gmail.com on 11 Mar 2010 at 12:42

GoogleCodeExporter commented 8 years ago
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 m.kaepp...@gmail.com on 11 Mar 2010 at 1:16

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
True. That problem was already raised elsewhere, and I'll look into it as part 
of a
forthcoming release.

Original comment by m.kaepp...@gmail.com on 12 Mar 2010 at 8:48

GoogleCodeExporter commented 8 years ago
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 m.kaepp...@gmail.com on 12 Mar 2010 at 5:30

GoogleCodeExporter commented 8 years ago
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 gemy2...@gmail.com on 17 Mar 2010 at 4:24

GoogleCodeExporter commented 8 years ago
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 m.kaepp...@gmail.com on 21 Mar 2010 at 1:33

GoogleCodeExporter commented 8 years ago
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 gemy2...@gmail.com on 24 Mar 2010 at 2:51

GoogleCodeExporter commented 8 years ago
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 m.kaepp...@gmail.com on 24 Mar 2010 at 2:59

GoogleCodeExporter commented 8 years ago
that was is the stack trace.

Original comment by gemy2...@gmail.com on 25 Mar 2010 at 8:34

GoogleCodeExporter commented 8 years ago
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 gemy2...@gmail.com on 25 Mar 2010 at 8:37

GoogleCodeExporter commented 8 years ago
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 m.kaepp...@gmail.com on 25 Mar 2010 at 8:48

GoogleCodeExporter commented 8 years ago
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 sriram....@gmail.com on 25 Mar 2010 at 6:06