I am completelly new to OAuth2 and I would like to get this example working before I move to integrate OAuth2 with my application. What I have done is the following:
- cd [someDirectory]
- hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples
- cd google-api-java-client-samples/oauth2-cmdline-ample
- cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json
- mvn compile
- mvn -q exec:java
This is the error I am getting while executing this code:
java.lang.NullPointerException at com.google.api.services.samples.oauth2.cmdline.OAuth2Sample.authorize(OAuth2Sample.java:81) at com.google.api.services.samples.oauth2.cmdline.OAuth2Sample.main(OAuth2Sample.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:290) at java.lang.Thread.run(Thread.java:662)