my dog learned polymorphism*
The moose likes Other Open Source Projects and the fly likes  I am using the OAUTH2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark " I am using the OAUTH2.0" Watch " I am using the OAUTH2.0" New topic
Author

I am using the OAUTH2.0

Gajendra Gaja
Greenhorn

Joined: Jul 18, 2011
Posts: 1
Hi All,
[javadoc]
I am using the OAUTH2.0 with below code,

OAuthServiceProvider provider = new OAuthServiceProvider(requestTokenURL, authorizationURL, accessTokenURL);
OAuthConsumer consumer = new OAuthConsumer("OAuth ", consumerKey, consumerSecret, provider);
OAuthAccessor accessor = new OAuthAccessor(consumer);
OAuthClient client = new OAuthClient(new HttpClient4());
List<Parameter> parameters = new ArrayList<OAuth.Parameter>();

parameters.add(new Parameter(ImsLtiLaunchParamDataKeys.OAUTH_CALLBACK, callBackUrl));
byte[] hash = DigestUtils.sha(IOUtils.toByteArray(new ByteArrayInputStream(body.getBytes())));
String b64 = new String(Base64.encodeBase64(hash),"UTF-8");

parameters.add(new Parameter(ImsLtiLaunchParamDataKeys.OAUTH_BODY_HASH, b64));
parameters.add(new Parameter("oauth_consumer_secret", consumerSecret));

OAuthMessage request = accessor.newRequestMessage(OAuthMessage.POST,requestTokenURL,parameters,new ByteArrayInputStream(body.getBytes()));

OAuthMessage msg =client.invoke(request, ParameterStyle.AUTHORIZATION_HEADER);

Our application getting following exception,

at net.oauth.client.OAuthResponseMessage.toOAuthProblemException(OAuthResponseMessage.java:83)
Please any one can help me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I am using the OAUTH2.0
 
Similar Threads
How to retrieve the parameters from a url in vaadin?
Problem Named Queries In Hibernate
importing one xml in another
not allowing 2 of the same imputs
HttpServletRequestWrapper won't return any getParamter value