I would recommend oacurl , which allows you to request a query from the command line. Although it is built to use Google services by supplying a properties file, you can talk to any OAuth service.
I am creating a configuration file (e.g. service.properties):
consumerKey=mykey consumerSecret=mysecret requestTokenUrl=https://service/oauth/request_token userAuthorizationUrl=https://service/oauth/authorize accessTokenUrl=https://localhost/oauth/access_token
after which the JAR is loaded into the same directory, login:
java -cp oacurl-1.3.0.jar com.google.oacurl.Login --service-provider=service.properties --consumer=service.properties
this should launch your browser and allow you to log in and save the access token (along with other information) in the ~ / .oacurl.properties files. You can then request the URL using an access token with:
java -cp oacurl-1.3.0.jar com.google.oacurl.Fetch https:
and he will use your access token to download it.
Matthew buckett
source share