Open GoogleCodeExporter opened 9 years ago
Also, I saw a couple of threads while googling. Something involving using
HmacSHA1, but I cannot figure out where I need to add that on Scribe code.
Original comment by iceal.th...@gmail.com
on 23 Apr 2012 at 9:49
Typo :
My question is that, why does it work for Twitter and not in LinkedIn. Is there
a special way to call LinkedIn, similar to Facebook API where no token should
be passed?
Original comment by iceal.th...@gmail.com
on 23 Apr 2012 at 9:51
i working on grails version 2+ ... and have the same problem ....
everybody help @@@
this problem here :
Token accessToken = service.getAccessToken(rt, v);
Original comment by thaigiab...@gmail.com
on 1 Nov 2012 at 3:32
I am getting error: Exception in thread "main" org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: 'oauth_problem=verifier_invalid' at org.scribe.extractors.TokenExtractorImpl.extract(TokenExtractorImpl.java:41)
Token accessToken = service.getAccessToken(requestToken, verifier);
i am getting these value: Trading the Request Token for an Access Token...Token[0ec828f4e3d30c0d6bbc6e7a14c34553 , d5e06e0a91b51b82a9d52a9438e159fb] But not able to rid of this exception.
complete cod is:
public static void main(String[] args) {
final String MAGENTO_API_KEY = "1e4ba1c18fab07ce17297c468236c475";
final String MAGENTO_API_SECRET = "d39d101b5daa21e4735c1a85ea059d94";
final String MAGENTO_REST_API_URL = "http://localhost/magento/api/rest/";
OAuthService service = new ServiceBuilder()
.provider(MagentoThreeLeggedOAuth.class)
.apiKey(MAGENTO_API_KEY)
.apiSecret(MAGENTO_API_SECRET)
.callback("http://sasken.com/MagentoScribe").build();
// .build();
System.out.println("" + service.getVersion());
Scanner in = new Scanner(System.in);
System.out.println("Magento's OAuth Workflow");
System.out.println();
// Obtain the Request Token
System.out.println("Fetching the Request Token...");
Token requestToken = service.getRequestToken();
System.out.println("Got the Request Token!" +requestToken);
System.out.println();
System.out.println("Fetching the Authorization URL...");
// MagentoThreeLeggedOAuth serv = new MagentoThreeLeggedOAuth();
// System.out.println("seervice class:"+service.getClass());
String authorizationUrl = service.getAuthorizationUrl(requestToken);
String word ="";
String token1 = requestToken.toString();
System.out.println("token1 :" + token1.length());
String[] strArray = token1.split(",");
for(int i=0;i<= token1.length();i++)
{
word = strArray[1];
//word = word.substring(1);
word = word.replaceAll("]", "");
}
System.out.println("word vale is :" + word);
System.out.println("Got the Authorization URL!");
System.out.println("Now go and authorize Main here:");
System.out.println(authorizationUrl);
System.out.println("And paste the authorization code here");
System.out.print(">>");
// String authUrl = serv.getAuthorizationUrl(requestToken);
// System.out.println("authUrl::"+ authUrl);
// Verifier verifier = new Verifier(authUrl);
// Verifier verifier = new Verifier(in.nextLine());
Verifier verifier = new Verifier(word);
// System.out.println("varifier::" +verifier.toString());
// Verifier verifier = new Verifier("7d4fa4e31d15fbc7b3c4e5eee936eb63");
System.out.println("Trading the Request Token for an Access Token..." + requestToken );
System.out.println("varifier::" + verifier.getValue());
System.out.println("requestToken:" + requestToken.getToken());
Token accessToken = service.getAccessToken(requestToken, verifier);
System.out.println("Got the Access Token!");
System.out.println("(if your curious it looks like this: "
+ accessToken + " )");
System.out.println();
OAuthRequest request = new OAuthRequest(Verb.GET, MAGENTO_REST_API_URL+ "/products?limit=2");
service.signRequest(accessToken, request);
Response response = request.send();
System.out.println();
System.out.println(response.getCode());
System.out.println(response.getBody());
System.out.println();
}
}
Original issue reported on code.google.com by
iceal.th...@gmail.com
on 23 Apr 2012 at 9:44