I want to mess around with an API from the command line. I'm looking for a good command line tool with Oauth support.
Any suggestions?
I'd recommend oacurl which allows you to make request from the command line. Although it is build to use Google services by supplying a properties file you can have it talk to any OAuth service.
I create a config file (eg service.properties):
consumerKey=mykey
consumerSecret=mysecret
requestTokenUrl=https://service/oauth/request_token
userAuthorizationUrl=https://service/oauth/authorize
accessTokenUrl=https://localhost/oauth/access_token
then with the JAR downloaded to 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 login and store your access token (along with other information) in ~/.oacurl.properties . Then you can request a URL using the access token with:
java -cp oacurl-1.3.0.jar com.google.oacurl.Fetch https://service/protected/path
and it will use your access token to download it.
https://github.com/decklin/curlicue
This is a nice tool for doing Oauth at command line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With