Oauth-enabled API command-line tools

I want to communicate with the API from the command line. I am looking for a good Oauth-enabled command line tool.

Any suggestions?

+7
source share
2 answers

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://service/protected/path 

and he will use your access token to download it.

+6
source

https://github.com/decklin/curlicue

This is a good tool to run Oauth on the command line.

+2
source

All Articles