0

Three Legged OAuth with Java on yahoo

here's a sample java class that tries to do three legged oauth with Yahoo.
using Google's client to sign it with HMAC-SHA1.
When you run it -> it stops with the url to go to for verification and waits for user input to confirm verification.
All of that runs fine,
The last request fails with an "Invalid Credentials" response.
Am not sure what's wrong here, possibly how the authorization header is being constructed???





import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Random;
import java.util.StringTokenizer;

import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.ProxyHost;
import org.apache.commons.httpclient.methods.GetMethod;

import com.google.gdata.client.authn.oauth.OAuthHelper;
import com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer;
import com.google.gdata.client.authn.oauth.OAuthParameters;
import com.google.gdata.client.authn.oauth.OAuthUtil;


public class YahooOAuth {

static String key = "KKKKKKKKEEEEEEEEEYYYYY";
static String secret = "SSSSSSSECCCCCCCRETTTT";
static String appId = "APPIDDD";
static String callback = "CALLLBACCK";


/**
*
* @return
* @throws MalformedURLException
* @throws Exception
*/
public static Map getLoginUrl() throws MalformedURLException, Exception {

Map get_request_token = new HashMap();
String reqUrl = "https://api.login.yahoo.com/oauth/v2/"
+ "get_request_token?" + "oauth_nonce="
+ new Random().nextInt() + "&oauth_timestamp="
+ ((int) (System.currentTimeMillis() / 1000))
+ "&oauth_consumer_key=" + key
+ "&oauth_signature_method=plaintext" + "&oauth_signature="
+ secret+"%26" + "&oauth_version=1.0";

String resp = getResponse(reqUrl);
StringTokenizer st = new StringTokenizer(resp, "&");
while (st.hasMoreTokens()) {
String token = st.nextToken();
get_request_token.put(token.substring(0, token.indexOf("=")), token
.substring(token.indexOf("=") + 1, token.length()));
}
System.out.println("Map got : " + get_request_token);

return get_request_token;

}

private static String getResponse(String reqUrl) throws Exception{
HttpClient client = new HttpClient();
/*boolean usingProxy = new Boolean(PropertyStore.getBaseProperty("using_proxy")).booleanValue();

if(usingProxy)
{
ProxyHost proxy = new ProxyHost(PropertyStore.getBaseProperty("proxy"),
new Integer(PropertyStore.getBaseProperty("proxy_port")).intValue());
client.getHostConfiguration().setProxyHost(proxy);
}*/
GetMethod getm = new GetMethod(reqUrl);
client.executeMethod(getm);
return getm.getResponseBodyAsString();
}

public static Map getAccessTokenMap(String authToken, String osecret)
throws Exception {
Map accessMap = new HashMap();
String accUrl = "https://api.login.yahoo.com/oauth/v2/get_token?"
+ "&oauth_consumer_key=" + key
+ "&oauth_signature_method=plaintext" + "&oauth_signature="
+ secret +"%26"+osecret + "&oauth_version=1.0" + "&oauth_nonce="
+ new Random().nextInt() + "&oauth_timestamp="
+ ((int) (System.currentTimeMillis() / 1000)) + "&oauth_token="
+ authToken;

String resp = getResponse(accUrl);
System.out.println(resp);
StringTokenizer st = new StringTokenizer(resp, "&");
while (st.hasMoreTokens()) {
String token = st.nextToken();
accessMap.put(token.substring(0, token.indexOf("=")), token
.substring(token.indexOf("=") + 1, token.length()));
}
System.out.println(accessMap);
return accessMap;

}

public static void main(String[] args) throws MalformedURLException,
Exception {
// System.out.println(getLoginUrl());
Map<String, String> reqMap = getLoginUrl();
String loginUrl = URLDecoder.decode((String) reqMap
.get("xoauth_request_auth_url"))
+ "&oauth_callback=" + callback;
System.out.println(loginUrl);

getStringFromShell("Verify identity at "+loginUrl);

Map<String, String> accMap = getAccessTokenMap(reqMap
.get("oauth_token"), reqMap.get("oauth_token_secret"));

String guid = accMap.get("xoauth_yahoo_guid");
String url = "http://social.yahooapis.com/v1/user/" + guid
+ "/profile?format=json";

/*Map params = new HashMap(accMap);
params.put("oauth_signature_method", "HMAC-SHA1");
params.put("oauth_nonce", new Random().nextInt() + "");
params.put("oauth_timestamp", (int) (System.currentTimeMillis() / 1000)
+ "");
params.remove("oauth_signature");*/

OAuthParameters oaup = new OAuthParameters();
oaup.setOAuthCallback(callback);
oaup.setOAuthConsumerKey(key);
oaup.setOAuthConsumerSecret(secret);
oaup.setOAuthNonce(OAuthUtil.getNonce());
oaup.setOAuthTimestamp(OAuthUtil.getTimestamp());
oaup.setOAuthToken(accMap.get("oauth_token"));
oaup.setOAuthTokenSecret(accMap.get("oauth_token_secret"));


String baseString = OAuthUtil
.getSignatureBaseString(url, "GET", oaup.getBaseParameters());

System.out.println("Base String " + baseString);
OAuthHmacSha1Signer sgner = new OAuthHmacSha1Signer();
String signature = (sgner.getSignature(baseString, oaup));

/*GET http://social.yahooapis.com/v1/user/abcdef...ile?format=json
Authorization: OAuth
realm="yahooapis.com",
oauth_consumer_key="dj0yJmk9nM9Y29uc3VtZXJzZWNyZXQmeD1lMg--",
oauth_nonce="24829.2331",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1219450170",
oauth_token="A%3DuqkiebGpiTJl7ThQxU.jDXXaETYyfEy3xAKPyoavokwOOcZcz8Xs_l1Nvnl._
KmCEVCeLkxxT1Y6BgRqf5f98sQWHklBM_anetveR7okK_M_5XEmQ1_1reo3UgKQULT_dQT8Gao3.
Rrgz5rJxgmnYrhdWWdfgTdMQVzpbJT2aGkz59NTK1O8yXVE1EvZUCqju7WiFYu.WHNEw.9TWq3g--",
oauth_version="1.0",
oauth_signature="O2AQipLITO0aYHKZc9266RzC94%3D"*/

oaup.setOAuthSignature(signature);
oaup.setOAuthSignatureMethod("HMAC-SHA1");
oaup.setRealm("yahooapis.com");

/*String p1 = oaup.getBaseParameters().toString().replace("{", "").replace("}","").replace(", ","&");

String p2 = oaup.getExtraParameters().toString().replace("{", "").replace("}","").replace(", ","&");*/

HttpClient client = new HttpClient();
/*boolean usingProxy = new Boolean(PropertyStore.getBaseProperty("using_proxy")).booleanValue();

if(usingProxy)
{
ProxyHost proxy = new ProxyHost(PropertyStore.getBaseProperty("proxy"),
new Integer(PropertyStore.getBaseProperty("proxy_port")).intValue());
client.getHostConfiguration().setProxyHost(proxy);
}*/
GetMethod getm = new GetMethod(url.toString());


/* String authString = "OAuth \n";
authString = (authString+p1+p2).replace("=","=\"").replace("&", "\"\n");
System.out.println(authString);*/
Map params = new LinkedHashMap();
params.put(OAuthParameters.OAUTH_CONSUMER_KEY, oaup.getOAuthConsumerKey());
params.put(OAuthParameters.OAUTH_NONCE_KEY, oaup.getOAuthNonce());
params.put(OAuthParameters.OAUTH_SIGNATURE_METHOD_KEY, oaup.getOAuthSignatureMethod());
params.put(OAuthParameters.OAUTH_TIMESTAMP_KEY, oaup.getOAuthTimestamp());
params.put(OAuthParameters.OAUTH_TOKEN_KEY, oaup.getOAuthToken());
params.put("oauth_version","1.0");
params.put(OAuthParameters.OAUTH_SIGNATURE_KEY, oaup.getOAuthSignature());

String aHeader = getAuthorizationHeader(oaup.getRealm(), params);
System.out.println("HEader "+aHeader);
Header hdr = new Header("Authorization", aHeader);
getm.addRequestHeader(hdr);

//client.
/* getm.addRequestHeader(OAuthParameters.REALM_KEY, oaup.getRealm());

//getm.addRequestHeader("oauth_version", "1.0");
getm.addRequestHeader(OAuthParameters.OAUTH_SIGNATURE_KEY, oaup.getOAuthSignature());*/

client.executeMethod(getm);

System.out.println(getm.getResponseBodyAsString());

System.out.println("URL : "+url);


}

public static String getStringFromShell(String prompt) {
try {
System.out.print(prompt);
return new BufferedReader(new InputStreamReader(System.in))
.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}

/** The encoding used to represent characters as bytes. */
public static final String ENCODING = "UTF-8";
public static String percentEncode(String s) {
if (s == null) {
return "";
}
try {
return URLEncoder.encode(s, ENCODING)
// OAuth encodes some characters differently:
.replace("+", "%20").replace("*", "%2A")
.replace("%7E", "~");
// This could be done faster with more hand-crafted code.
} catch (UnsupportedEncodingException wow) {
throw new RuntimeException(wow.getMessage(), wow);
}
}

/**
* Construct a WWW-Authenticate or Authentication header value, containing
* the given realm plus all the parameters whose names begin with "oauth_".
*/
public static String getAuthorizationHeader(String realm, Map parameters) throws IOException {
StringBuilder into = new StringBuilder();
if (realm != null) {
into.append(" realm=\"").append(percentEncode(realm)).append('"');
}
if (parameters != null) {
for (Iterator iterator = parameters.entrySet().iterator(); iterator.hasNext()wink.gif {
Map.Entry parameter = (Map.Entry) iterator.next();
String name = parameter.getKey().toString();
if (name.startsWith("oauth_")) {
if (into.length() > 0) into.append(",\n");
into.append(" ");
into.append(percentEncode(name)).append("=\"");
into.append(percentEncode(parameter.getValue().toString())).append('"');
}
}
}
return "OAuth \n" + into.toString();
}

}

by
16 Replies
  • Hi Teramera,

    Which request is failing? Is this the request to fetch the Access Token after the user authorizes your consumer? My Java is a bit rusty.
    0
  • I am having the same issue, did anybody happen to get an answer?
    0
  • The access token works fine . The authenticated getProfile api call is failing.
    String url = "http://social.yahooapis.com/v1/user/" + guid
    + "/profile?format=json";

    QUOTE (atom @ Mar 5 2009, 08:58 PM) <{POST_SNAPBACK}>
    Hi Teramera,

    Which request is failing? Is this the request to fetch the Access Token after the user authorizes your consumer? My Java is a bit rusty.
    0
  • No Answer Yet.
    Still an open issue.
    QUOTE (scott m @ Mar 14 2009, 09:49 PM) <{POST_SNAPBACK}>
    I am having the same issue, did anybody happen to get an answer?
    0
  • QUOTE (teramera @ Mar 26 2009, 11:43 AM) <{POST_SNAPBACK}>
    No Answer Yet.
    Still an open issue.


    Hi Teramera,

    What is the value of the WWW-Authenticate HTTP header in the response? OAuth protected Yahoo APIs return problem descriptions in the WWW-Authenticate HTTP header using the OAuth Problem Reporting extension.

    One difference with OAuth for Yahoo services is that Yahoo's Access Tokens expire after one hour. You can refresh the access token (without user intervention) using the API documented in the "Refresh The Access token" section of our OAuth documenation:
    http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html
    0
  • Any one succeeded in getting yahoo contacts using oauth, I am also getting reported as "Invalid Credentials".
    wat is the problem with the java approach!
    Any other approach suggested? Couldnt find any other clue in the approach.
    0
  • QUOTE (selvam a @ Jun 14 2009, 10:00 PM) <{POST_SNAPBACK}>
    Any one succeeded in getting yahoo contacts using oauth, I am also getting reported as "Invalid Credentials".
    wat is the problem with the java approach!
    Any other approach suggested? Couldnt find any other clue in the approach.


    Actually I found a couple of different issues. First of all it looked like you need the private data access signing up for the key. At the first attempt I did not specify any of the accesses and then got a 401. Then I check all the accesses and was able to move on.

    Doing the PLAINTEXT authentication for the request token works but when I try the same thing with the GData and HMAC signing I get a 401 too.
    Have not figured it out and the only thing that it can cause it is how the client and server side arranges the oauth parameters for the hash string.

    It looks like the google data API is doing it in a different way then the yahoo API is expecting it to. At least the GData code works against Picasa with the 1.0a extensions.It would be good if anyone could post the oauth signature generation code that is successful or if Yahoo could write the exact steps and order of parameter names that it validates to.

    Since it says that using the PLAINTEXT is sending the data unencrypted over internet is not a good idea (Look at Tip http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html)

    BR Stoffe
    0
  • Hi guys,
    has anybody managed to solve this? Got stuck on this as well - I can get as far as to obtaining the access token, but when I use it to call the Contacts API, this is what I am getting:

    {"error":{"lang":"en-US","description":"Please provide valid credentials. OAuth oauth_problem=\"token_rejected\", realm=\"yahooapis.com\""}}
    WWW-Authenticate: OAuth oauth_problem="token_rejected", realm="yahooapis.com"

    Thanks.
    0
  • QUOTE (hrus4k @ Oct 15 2009, 02:15 PM) <{POST_SNAPBACK}>
    Hi guys,
    has anybody managed to solve this? Got stuck on this as well - I can get as far as to obtaining the access token, but when I use it to call the Contacts API, this is what I am getting:

    {"error":{"lang":"en-US","description":"Please provide valid credentials. OAuth oauth_problem=\"token_rejected\", realm=\"yahooapis.com\""}}
    WWW-Authenticate: OAuth oauth_problem="token_rejected", realm="yahooapis.com"

    Thanks.



    The token is likely no longer valid. Can you provide the entire request/response?
    0
  • QUOTE (Dustin Whittle @ Oct 15 2009, 04:11 PM) <{POST_SNAPBACK}>
    The token is likely no longer valid. Can you provide the entire request/response?


    thanks for your response Dustin.

    I do not think this is the case as I use the token immediately after obtaining it.

    Anyway, here is my request:

    http://social.yahooapis.com/v1/user/LGSOMS...cts?format=json

    with the following "Authorization" header:

    OAuth realm="yahooapis.com", oauth_consumer_key="dj0yJmk9UjVlTXM1UG9aellJJmQ9WVdrOVUyUnphemRUTm5FbWNHbzlOakUyT1RBMU5qWXkmcz1
    jb25zdW1lcnNlY3JldCZ4PWU4", oauth_nonce="10410757827342751", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1255682009", oauth_token="A%253DDX4CrFjSriCpwbCfQEJXSC0dM6jteH0cT5HTimooWLnG1oh_6w3.5Ux_xXkluMLpFU4lhNy79Sl8
    sWAY.2_olDKW9yLSquS8o3dpv65tVebx_3qAgssBcmfPbH7rwn4WtHg3faOWbayGv2zPSirKtL4E1rTFi
    9IOqqdksCBILhJqAGWvZ6lBuVexG90Wlu8BaTPliMxUUXQSJZT9zd56NuBxjXKkmud1fdTcDXyl.FrmZZ
    Wz8evBjT_cQIQUVFPVTSnhKcdJik42WCQSgK2v2uodS6WuSYUTtO8tXHDjRrw.Y9wEI.q45RjAePHGmpS
    xTVzkdhCBgoRqyUsO1o7r62DK_D9v3iQGLv2DPzOa835tQgpdEdoNp4ZltyK8UHSWasqMs.8TlMcOzfay
    UM1tghqhBmpT74atXJzaS9MIev7sD2rw1bm1VltH83.hJnrt_doD_zXl3TkyGT1zNK_G54kCniUs6upVe
    DQw9cQUUfM0f5zWu1fVtpypcM.PjZ2HGrn5ui_X2H2mOqaEjgjf3SbJAFUmQZvdstxQrxMJ1pL0Bh5ydN
    nYVZw4M5dhLWeV20R2sYvKC8AhjOKf2YAb3UgaP_TLl4fe7KlT9xo9MIzxjUURlNXB1ycHHRlfGyHnwE2
    K0V.x7mOM29y0FXIMduOf7_PblZFE0QmL9PNAyam513D.bW72tFe4moPXSwX9t4rF1YQzGttNCVP2JZ4B
    NcZP77SNjQ--", oauth_version="1.0", oauth_signature="jpmvYThUwHx5%2FASl4FT0c0rolSs%3D"


    And the (401) response I am getting is always the same:

    {"error":{"lang":"en-US","description":"Please provide valid credentials. OAuth oauth_problem=\"token_rejected\", realm=\"yahooapis.com\""}}

    with these headers:

    Date: Fri, 16 Oct 2009 08:21:36 GMT
    WWW-Authenticate: OAuth oauth_problem="token_rejected", realm="yahooapis.com"
    Vary: Accept-Encoding
    Content-Type: application/json
    Age: 0
    Transfer-Encoding: chunked
    Connection: keep-alive
    Via: HTTP/1.1 r2.ycpi.uls.yahoo.net (YahooTrafficServer/1.17.16 [cMsSf ])
    Server: YTS/1.17.16
    0
  • QUOTE (hrus4k @ Oct 16 2009, 01:37 AM) <{POST_SNAPBACK}>
    thanks for your response Dustin.

    I do not think this is the case as I use the token immediately after obtaining it.

    Anyway, here is my request:

    http://social.yahooapis.com/v1/user/LGSOMS...cts?format=json

    with the following "Authorization" header:

    OAuth realm="yahooapis.com", oauth_consumer_key="dj0yJmk9UjVlTXM1UG9aellJJmQ9WVdrOVUyUnphemRUTm5FbWNHbzlOakUyT1RBMU5qWXkmcz1
    jb25zdW1lcnNlY3JldCZ4PWU4", oauth_nonce="10410757827342751", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1255682009", oauth_token="A%253DDX4CrFjSriCpwbCfQEJXSC0dM6jteH0cT5HTimooWLnG1oh_6w3.5Ux_xXkluMLpFU4lhNy79Sl8
    sWAY.2_olDKW9yLSquS8o3dpv65tVebx_3qAgssBcmfPbH7rwn4WtHg3faOWbayGv2zPSirKtL4E1rTF
    i
    9IOqqdksCBILhJqAGWvZ6lBuVexG90Wlu8BaTPliMxUUXQSJZT9zd56NuBxjXKkmud1fdTcDXyl.FrmZ
    Z
    Wz8evBjT_cQIQUVFPVTSnhKcdJik42WCQSgK2v2uodS6WuSYUTtO8tXHDjRrw.Y9wEI.q45RjAePHGmp
    S
    xTVzkdhCBgoRqyUsO1o7r62DK_D9v3iQGLv2DPzOa835tQgpdEdoNp4ZltyK8UHSWasqMs.8TlMcOzfa
    y
    UM1tghqhBmpT74atXJzaS9MIev7sD2rw1bm1VltH83.hJnrt_doD_zXl3TkyGT1zNK_G54kCniUs6upV
    e
    DQw9cQUUfM0f5zWu1fVtpypcM.PjZ2HGrn5ui_X2H2mOqaEjgjf3SbJAFUmQZvdstxQrxMJ1pL0Bh5yd
    N
    nYVZw4M5dhLWeV20R2sYvKC8AhjOKf2YAb3UgaP_TLl4fe7KlT9xo9MIzxjUURlNXB1ycHHRlfGyHnwE
    2
    K0V.x7mOM29y0FXIMduOf7_PblZFE0QmL9PNAyam513D.bW72tFe4moPXSwX9t4rF1YQzGttNCVP2JZ4
    B
    NcZP77SNjQ--", oauth_version="1.0", oauth_signature="jpmvYThUwHx5%2FASl4FT0c0rolSs%3D"


    And the (401) response I am getting is always the same:

    {"error":{"lang":"en-US","description":"Please provide valid credentials. OAuth oauth_problem=\"token_rejected\", realm=\"yahooapis.com\""}}

    with these headers:

    Date: Fri, 16 Oct 2009 08:21:36 GMT
    WWW-Authenticate: OAuth oauth_problem="token_rejected", realm="yahooapis.com"
    Vary: Accept-Encoding
    Content-Type: application/json
    Age: 0
    Transfer-Encoding: chunked
    Connection: keep-alive
    Via: HTTP/1.1 r2.ycpi.uls.yahoo.net (YahooTrafficServer/1.17.16 [cMsSf ])
    Server: YTS/1.17.16


    hrus4k,

    It is likely an encoding problem. Can you provide the actual code you are using to make the request?
    0
  • QUOTE (Dustin Whittle @ Oct 16 2009, 03:30 PM) <{POST_SNAPBACK}>
    hrus4k,

    It is likely an encoding problem. Can you provide the actual code you are using to make the request?


    Hi Dustin,

    I am using Google OAuth libraries for the encoding stuff (namely OAuthHmacSha1Signer, OAuthHelper, OAuthParameters and OAuthUtil).

    I can get to the point of having the access token, consequently, I call the following method in which the request with the Authorization header is put together and sent to the Contacts API ..but gets a 401-token rejected. Until this point everything works fine, so I suppose if there is problem in my code, it should be this method:

    public static void callContactsAPI(Map<String, String> accessMap) throws OAuthException, IOException {

    String guid = accessMap.get("xoauth_yahoo_guid");
    String url = "http://social.yahooapis.com/v1/user/" + guid + "/contacts?format=json";



    OAuthParameters params = new OAuthParameters();
    params.setOAuthConsumerKey(key);
    params.setOAuthConsumerSecret(secret);
    params.setOAuthCallback(callback);
    params.setOAuthNonce(OAuthUtil.getNonce());
    params.setOAuthTimestamp(OAuthUtil.getTimestamp());
    params.setOAuthToken(accessMap.get("oauth_token"));
    params.setOAuthTokenSecret(accessMap.get("oauth_token_secret"));
    params.setOAuthSignatureMethod("HMAC-SHA1");
    params.setRealm("yahooapis.com");


    String baseString = OAuthUtil.getSignatureBaseString(url, "GET", params.getBaseParameters());
    OAuthHmacSha1Signer signer = new OAuthHmacSha1Signer();
    String signature = (signer.getSignature(baseString, params));

    params.setOAuthSignature(signature);

    GetMethod getMethod = new GetMethod(url.toString());

    String aHeader = new OAuthHelper(null, null, null, signer).getAuthorizationHeader(url, "GET", params);
    Header hdr = new Header("Authorization", aHeader);
    getMethod.addRequestHeader(hdr);


    HttpClient client = new HttpClient();
    int responseCode = client.executeMethod(getMethod);

    System.out.println("URL : " + url);
    System.out.println(responseCode);
    System.out.println(String.valueOf(responseCode));
    System.out.println(getMethod.getResponseBodyAsString());
    Header[] headers = getMethod.getResponseHeaders();
    for(Header h : headers) {
    System.out.println(h.toString());
    }

    }
    0
  • did u managed to solve it, I'm getting the same error, I've the access token , but can't get the contact list
    0
  • Hi dror_yaffe,

    Can you please provide your consumer key as well as the complete request
    and response headers you got so we can check from our end?

    Following is an example of what we would like to see:

    Consumer key: dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNVGszTVRBM05USXhOQS0tJnM9
    Y29uc3VtZXJzZWNyZXQmeD02MQ--
    URL: https://api.login.yahoo.com/oauth/v2/get_request_token
    HTTP POST data: oauth_version=1.0&oauth_nonce=8c76a87ffd3e4f48b53ed4b669b0b35f&oauth_timestamp=1268432350&oauth_consumer_key=dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNV
    GszTVRBM05USXhOQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD02MQ--&oauth_signature_method=PLAINTEXT&oauth_signature=821ce9362da7d3d441265e77469a1339c42097612526&oauth_callback=oob"

    Thanks,
    Yu Wang
    Yahoo! Membership team
    0
  • Hey Had u got The result Successfully.I'm getting oauth_problem=signature_invalid.I had used the same code that u used.Plz reply to it...
    0
  • Hi JANU,

    Can you please provide your consumer key as well as the complete request
    and response headers you got so we can check from our end?

    Following is an example of what we would like to see:

    Consumer key: dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNVGszTVRBM05USXhOQS0tJnM9
    Y29uc3VtZXJzZWNyZXQmeD02MQ--
    URL: https://api.login.yahoo.com/oauth/v2/get_request_token
    HTTP POST data: oauth_version=1.0&oauth_nonce=8c76a87ffd3e4f48b53ed4b669b0b35f&oauth_timestamp=1268432350&oauth_consumer_key=dj0yJmk9TUJETmxhUG9WbDlPJmQ9WVdrOWR6Um9kRkl3TXpRbWNHbzlNV
    GszTVRBM05USXhOQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD02MQ--&oauth_signature_method=PLAINTEXT&oauth_signature=821ce9362da7d3d441265e77469a1339c42097612526&oauth_callback=oob"

    Please open a new topic as the original post is very old and things have
    changed a lot. For example, now we support only OAuth 1.0 RevA that requires
    oauth_verifier for the get_token call.

    Thanks,
    Yu Wang
    Yahoo! Membership team
    0

Recent Posts

in OAuth General Discussion YDN SDKs