async-oauth2 0.1.0

Bindings for exchanging OAuth 2 tokens
Documentation

async-oauth2

Crates Actions Status

An async/await implementation of OAuth2 for Rust.

This is a fork of oauth2-rs.

The main differences are:

  • Removal of unecessary type parameters on Client (see discussion here).
  • Only support one client implementation (reqwest).
  • Remove most newtypes except Scope and the secret ones since they made the API harder to use.

Documentation is available on docs.rs or check the examples.

Examples

If you want to run some of our examples, you need to register an application that has a redirect URL of http://localhost:8080/api/auth/redirect, then you can run the clients like this:

cargo run --manifest-path=examples/Cargo.toml --bin spotify --client-id <client-id> --client-secret <client-secret>
cargo run --manifest-path=examples/Cargo.toml --bin google --client-id <client-id> --client-secret <client-secret>
cargo run --manifest-path=examples/Cargo.toml --bin twitch --client-id <client-id> --client-secret <client-secret>