oauth2 with curl 0.3
A fork of oauth2-rs
- However, I have support for the newest versions of the dependencies, including
curl
version0.3.0
and url version1.1.1
. - The interface is exactly the same as the base repository
- Documentation available here
As an example, follow the example here:
extern crate rustc_serialize;
extern crate oauth-api;
use json;
use File;
use Read;
/* Secrets.json sample contents:
{
"client_id": "abcde",
"client_secret": "efgab",
"auth_url": "https://github.com/login/oauth/authorize",
"token_url": "https://github.com/login/oauth/access_token"
}
*/
let mut f = open.unwrap;
let mut read_str = String new;
let _ = f.read_to_string;
let sec : Secret = decode.unwrap;
let mut conf = new;
conf.scopes = vec!;
let url = conf.authorize_url;
println!;
let mut user_code = String new;
let _ = stdin.read_line.unwrap;
user_code.pop;
let tok = conf.exchange.unwrap;
println!;
Contributing
- I gladly accept all PRs
- Please feel free to submit any issues for issues and/or feature requests