graph-oauth 0.2.1

Microsoft Graph api oauth client for the graph-rs project


OAuth client for Microsoft Graph and the graph-rs project.

See the project on GitHub.

Authorization Flows and Microsoft Graph

1. Token Flow - v1.0
2. Code Flow - v1.0
3. Authorization Code Grant - v1.0 and beta
4. Open ID - v1.0 and beta
5. Implicit - v1.0 and beta
6. Client Credentials - v1.0 and beta
7. Resource Owner Password Credentials - v1.0 and beta

For more examples see the example's directory in the graph-rs project on GitHub.

For more information on Microsoft graph and OAuth 2.0 authorization flows see:

use graph_oauth::oauth::OAuth;

fn main() {
    let mut oauth = OAuth::new();

    let mut request =;
    // Opens the default browser.
    let _ = request.browser_authorization().open();
    // The access code will be appended to the url on redirect. Pass
    // this code to the OAuth instance:
    oauth.access_code("<ACCESS CODE>");

    // Perform an authorization code grant request for an access token:
    let mut request =;
    let access_token = request.access_token().send().unwrap();
    println!("{:#?}", access_token);