Hi there,
I´m trying to use the opensocial java client in a desktop application, to get a list of my friends from myspace.
I´ve imported the required libraries an the opensocial code under /java/src/org. Then I´ve written my own class to try to connect to myspace, just like the tutorial http://code.google.com/p/opensocial-java-client/wiki/HowToConnecting said....
public static void main(String[ args) {
// TODO Auto-generated method stub
Provider provider = new MySpaceProvider();
AuthScheme scheme = new OAuth2LeggedScheme("19723c3a31f74b3599f3e98c78ef9abe", "<consumer secret>");
Client client = new Client(provider, scheme);
Request request = PeopleService.getViewer();
try {
Response responses = client.send(request);
System.out.println(responses.toString());
} catch (RequestException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}catch (NullPointerException e){
e.printStackTrace();
}
Is the first parameter of OAuth2LeggedScheme just the consumer key or is "www.myspace.com/consumer key"?
Is the Scheme correct, or do I have to use OAuth3LeggedScheme ? As I got the consumer key and secrect from http://developers.myspace.com/, I´ve had to set an external URL and an External Callback Validation. What does this mean?
Could anybody give me an example please?
And what is an UserID?
AuthScheme scheme = new OAuth2LeggedScheme("<consumer key>", "<consumer secret>", "<user ID>");
Greetings
Asuka