0

What's wrong??

CODE
Hi!
I need an application to extract contactlist via YahooBBAuth. but when I call the url :

http://address.yahooapis.com/v1/searchContacts
?format=xml
&appid=JnR5h4LIkYmvVcPmA2xPj_1XK.hGV.nxdhPS
&WSSID=4083Sovmu5v

EntryPoint return a 403 status code:

Server returned HTTP response code: 403 for URL: http://address.yahooapis.com/v1/searchContacts?format=xml&appid=JnR5h4LIkYmvVcPmA2xPj_1XK.hGV.nxdhPS&WSSID=4083Sovmu5v

My code is equals to YahooBBAuthServer, with modifications for extract the contactlist:

...
...
/**
* Generate the portion of the URL that's used for signing.
* More information on BBAuth can be found here: <a href="http://developer.yahoo.com/auth/" target="_blank">http://developer.yahoo.com/auth/</a>
*/
String authWS = "/WSLogin/V1/wspwtoken_login";
String sig = authWS + "?appid=" + URLEncoder.encode(appId, "UTF-8") + "&token=" + URLEncoder.encode(token, "UTF-8") + "&ts=" + time + secret;
String signature = new BigInteger(1, digest.digest((sig).getBytes())).toString(16);
String authURL = "https://api.login.yahoo.com" + authWS + "?appid=" + appId + "&token=" + token + "&ts=" + time + "&sig=" + signature;
//out.println(authURL);
//out.println("
");

InputStream rstream = (new URL(authURL)).openStream();

/**
* Retrieve the XML response to the auth request and get the wssid and
* cookie values.
*/
Document xmlresponse = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(rstream);

String wssid = null;
String cookie = null;
String timeout = null;

// Check if token is in the response
NodeList wssidResponse = xmlresponse.getElementsByTagName("WSSID");
NodeList cookieResponse = xmlresponse.getElementsByTagName("Cookie");
NodeList timeoutResponse = xmlresponse.getElementsByTagName("Timeout");
Node wssidNode = wssidResponse.item(0);
Node cookieNode = cookieResponse.item(0);
Node timeoutNode = timeoutResponse.item(0);
if (wssidNode != null) {
out.println("BBauth authentication Successful");
out.println("
");
wssid = wssidNode.getTextContent();
cookie = cookieNode.getTextContent();
timeout = timeoutNode.getTextContent();
out.println("wssid = " + wssid);
out.println("
");
out.println("cookie = " + cookie);
out.println("
");
out.println("timeout = " + timeout);

URL contactsUrl = new URL("http://address.yahooapis.com/v1/searchContacts?format=xml&appid="+appId+"&WSSID="+wssid+"&wssid="+wssid);

InputStream is = contactsUrl.openStream();
byte[] buf = new byte[is.available()];
is.read(buf);
is.close();
String parse = new String(buf);

out.println(contactsUrl.toString()+"\n");
out.println(parse);
} else {
...
...

what's wrong?

thank you in advance !

by
4 Replies
  • Daniel,



    I've opened a bug on this and will let you know what happens. Thanks for letting us know!


    Robyn Tippins
    Community Manager, YDN
    0
  • Daniel,

    The bug is still in process, but I'll keep you updated as soon as status changes. Unfortunately we don't have a public facing bug reporting option, though it's on our radar.

    Robyn Tippins
    Community Manager, YDN
    0
  • Ok Robyn, I'm pending of solution of this bug. Where are the bugtracker?

    Thanks
    0
  • When making the webservices call, did you set the cookie with the request?
    0

Recent Posts

in General Discussion at YDN