Phabricator-OAuth
Library for OAuth2 authentication on Phabricator
Example
use *;
...
let phid = String from;
let secret = String from;
let redirect_url = String from; // Exactly like in oauth settings on phabricator
let phabricator_url = String from;
let client = new.unwrap;
...
// Getting URL for authentication on the phabricator
let redirect_url = client.get_auth_url.unwrap;
...
// Getting OAuth token. Code will be in GET parameters in your /auth handler
let token = client.get_token.unwrap;
let access_token = token.access_token;
...
// Getting current user info
let user = client.get_user.unwrap;