Library for OAuth2 authentication on Phabricator
Example ```rust use phabricatoroauth::*; ... let phid = String::from("PHABRICATORID"); let secret = String::from("PHABRICATORSECRET"); let redirecturl = String::from("https://yourservice.com/auth"); // Exactly like in oauth settings on phabricator let phabricator_url = String::from("https://phabricator.yourdomain.com");
let client = PhabOAuthClient::new(phid, secret, redirecturl, phabricatorurl).unwrap(); ... // Getting URL and CSRF token for authentication on the phabricator let (redirecturl, _csrftoken) = client.getauthurl().unwrap(); ... // Getting OAuth token. Code will be in GET parameters in your /auth handler let token = client.gettoken(code).await.unwrap(); let accesstoken = token.accesstoken(); ... // Getting current user info let user = client.getuser(access_token).await.unwrap(); ```