hi, I am able to use sandbox environment to under stand how oAuth is working.
Now I want to use real development using ORKUT as provider. OpenSocialProvider provider = OpenSocialProvider.valueOf("ORKUT"); final OpenSocialClient client = new OpenSocialClient (provider); String consumerKey = "Mykey"; String secretKey="MySerretkey"; client.setProperty (OpenSocialClient.Property.CONSUMER_SECRET, secretKey); client.setProperty(OpenSocialClient.Property.CONSUMER_KEY, consumerKey); Token token = OpenSocialOAuthClient.getRequestToken (client, provider); session.setAttribute("token_secret", token.secret); String AUTH_CALLBACK = "http://xxx.xxx.xxx.xxx/Orkut"; String url = OpenSocialOAuthClient.getAuthorizationUrl (provider, token, AUTH_CALLBACK); but here i am getting Url as "null?oauth_callback=http:// xxx.xxx.xxx.xxx/Orkut". Please advise how i can redirect to get requesttoken authenticated. thanks, Sudhakar On Nov 10, 4:15 am, los <carlo...@gmail.com> wrote: > Ahhhh, that was it! > > This step ought to be be made more clear in the documentation. > > Thanks a lot! U da man!! :) > > -Carlos > > On Nov 9, 9:26 am, Sachin Shenoy <therealsac...@gmail.com> wrote: > > > > > Hi Carlos, > > > You need to get 3-legged oauth consumer key / secret. Please follow > > instructions from the below URL. > > >http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.... > > > The one you are using will only allow you to make 2-legged oauth calls. > > > Regards, > > <http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto....> > > Sachin > > > On Fri, Nov 6, 2009 at 2:43 AM, los <carlo...@gmail.com> wrote: > > > > Hi Sachin, > > > > Thanks for the feedback. That playground is a nice tool to know > > > about. > > > > So I followed your instructions like this: > > > > 1. On panel 1 I enteredhttp://sandbox.orkut.gmodules.com/social/rpc > > > (I corrected the spelling mistake on the word "social") > > > 2. On panel 2 I set oauth_signature_method to HMAC-SHA1 > > > 3 Set oauth_consumer_key to orkut.com:121212121212 (I am using > > > 121212... as an example, I set the actual value in my test) > > > 4. Set consumer secret to abcdefabcedfabcdef (Again abcdef... is just > > > an example I set my correct secret in the test) > > > 5. clicked Request token on panel 3 > > > > I got a 400 response, with the result of "Consumer is not registered: > > > orkut.com:121212121212" > > > > So now I'm thinking that just because I have a consumer key and secret > > > it doesn't necessarily mean I can make requests to that provider? > > > > All I did to get the key & secret was create a hello world > > > mygadget.xml file and uploaded it to app engine. Then went to > > >https://www.google.com/gadgets/directory/verifyandentered the url of > > > my xml file, verified it was mine by updating the xml file with the > > > token and voila...I got my consumer key and secret. > > > > Feels like I'm just missing a simple detail somewhere. Any ideas what > > > I'm missing here? > > > > Thanks, > > > > Carlos > > > > On Nov 5, 7:32 am, Sachin Shenoy <therealsac...@gmail.com> wrote: > > > > Hi Carlos, > > > > > Before using opensocial java client library, I would suggest you using > > > oauth > > > > playground for testing out your authentication part. > > > > >http://googlecodesamples.com/oauth_playground/ > > > > > Here are the values you need to set. > > > > > panel(1) > > > > scope (input your own):http://sandbox.orkut.gmodules.com/socail/rpc > > > > > panel(2) > > > > hmac_signature_method: > > > > HMAC-SHA1 > > > > Fill in the oauth_consumer_key and secret, and then go ahead with > > > "Request > > > > Token", "Authorize" and "Access Token". > > > > > Once that is through you should be able to do run some simple requests > > > from. > > > > > panel (6) > > > > Set "application/json", method "POST", and body as > > > {'method':'people.get'} > > > > and click execute. > > > > > Once you succeed here it should be easier for you to figure out what the > > > > opensocial library is doing differently. > > > > > Regards, > > > > Sachin > > > > > On Thu, Nov 5, 2009 at 3:17 PM, los <carlo...@gmail.com> wrote: > > > > > > I'm trying to write a new java webapp and want it to display a user's > > > > > activities. I'd like to have this work with orkut to start out, but > > > > > hopefully would like to integrate with other opensocial containers > > > > > such as linkedin, myspace, etc... I'm currently using the opensocial > > > > > java client in my development. > > > > > > Right now I'm struggling trying to understand how to redirect the user > > > > > to orkut from my webapp so he can login if necessary add the > > > > > application to their profile, and then redirect this person back to my > > > > > webapp so that I can fetch the activities in the background and > > > > > display it on my app. > > > > > > I've noticied that the OpenSocialProvider.ORKUT is defined as: > > > > > > ORKUT(null, null, null, "http://www.orkut.com/social/rest/", > > > > > "http://www.orkut.com/social/rpc/", "orkut.com", > > > > > BodySigningMethod.SIGN_BODY_HASH, true), > > > > > > so there are no urls for requesting a token, authenticating url and > > > > > getting the access token. So I started using the > > > > > OpenSocialProvider.GOOGLE (since it has actual values for those urls > > > > > defined) in my code as follows. > > > > > > OpenSocialProvider provider = OpenSocialProvider.GOOGLE; > > > > > final OpenSocialClient client = new OpenSocialClient > > > > > (provider); > > > > > client.setProperty(OpenSocialClient.Property.CONSUMER_SECRET, > > > > > CONSUMER_SECRET); > > > > > client.setProperty(OpenSocialClient.Property.CONSUMER_KEY, > > > > > "igoogle.com:1212121212121212"); > > > > > OpenSocialLoginInfo loginInfo = new OpenSocialLoginInfo(); > > > > > session.setAttribute(OPEN_SOCIAL_CLIENT, client); > > > > > try { > > > > > Token token = OpenSocialOAuthClient.getRequestToken > > > > > (client, provider); > > > > > session.setAttribute("token_secret", token.secret); > > > > > String loginUrl = OpenSocialOAuthClient.getAuthorizationUrl > > > > > (provider, token, callbackUrl); > > > > > .... > > > > > } catch (Exception e) { > > > > > e.printStackTrace(); > > > > > } > > > > > > However, I always get the following exception: > > > > > > Exception in thread "main" java.io.IOException: Container returned > > > > > status 400 "Server returned HTTP response code: 400 for URL: > > > > > >https://www.google.com/accounts/OAuthGetRequestToken?scope=http%3A%2F. > > > .. > > > > > " > > > > > at org.opensocial.client.OpenSocialHttpClient.send > > > > > (OpenSocialHttpClient.java:118) > > > > > at org.opensocial.client.OpenSocialHttpClient.send > > > > > (OpenSocialHttpClient.java:89) > > > > > at org.opensocial.client.OpenSocialHttpClient.execute > > > > > (OpenSocialHttpClient.java:74) > > > > > at org.opensocial.client.OpenSocialHttpClient.execute > > > > > (OpenSocialHttpClient.java:45) > > > > > at org.opensocial.client.OpenSocialHttpClient.execute > > > > > (OpenSocialHttpClient.java:1) > > > > > at net.oauth.client.OAuthClient.invoke(OAuthClient.java:243) > > > > > at net.oauth.client.OAuthClient.invoke(OAuthClient.java:143) > > > > > at > > > > > net.oauth.client.OAuthClient.getRequestToken(OAuthClient.java:101) > > > > > at org.opensocial.client.OpenSocialOAuthClient.getRequestToken > > > > > (OpenSocialOAuthClient.java:170)- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to opensocial-orkut@googlegroups.com To unsubscribe from this group, send email to opensocial-orkut+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en -~----------~----~----~----~------~----~------~--~---