You need to sign in to do that
Don't have an account?
Java and OAuth
I have a Java native app I am trying to implement Oauth for. I have gone thru this article by Pat Patterson:
http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com
I am a little lost on a couple of points. I can work out how to make a call from Java to the initial URL (https://login.salesforce.com/services/oauth2/authorize?response_type=token&client_id=xxx&redirect_uri=myapp:oauth&display=full). From what I can see, this returns a redirect. What exactly does the Java app have to do to bring up the browser window with the authorization request? And how does the Java app then get back the reponse with the tokens?
Thx, Hamayoun
Do you really need OAuth on screen? Have you tried using the consumer key and consumer secret.
i am new to JAVA.i copied above code and made the changes like user name,pwd etc.bt i am facing below jar file problems like...
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.http.impl.client.CloseableHttpClient.<init>(CloseableHttpClient.java:58)
at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:287)
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:147)
at REST_Code.oauth2Login(REST_Code.java:151)
at REST_Code.<init>(REST_Code.java:114)
at REST_Code.main(REST_Code.java:65)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
please help me ...
what jar file exactly i need to add.
do reply...
Add org-apache-commons-logging.jar to your build path