github_auth
Authenticate with GitHub from the command line. Caches the authentication token so that future interactions just work.
Usage
extern crate github_auth;
use ;
let auth = builder
.scope
.build;
let token = auth.auth.unwrap;
println!;
let location = auth.location;
println!;
Example Output
This dialog is only required to generate a valid token. Once a valid token is created, it will no longer be shown.
GitHub username: my_name
GitHub password:
GitHub OTP (optional): 5678
Authenticating with the token
Once you've acquired an access token, you can use it to authenticate. Here's how to authenticate with the reqwest crate.
extern crate github_auth;
extern crate reqwest;
use Authenticator;
use ;
let auth = new;
let token = auth.auth.unwrap;
let mut headers = new;
headers.set;
headers.set;
let url = "https://api.github.com/user";
let mut res = client.get.headers.send?;
println!;
Installation
License
MIT OR Apache-2.0