The current Git master doesn't build with Rust 1.17 because the version of Rustls used on master doesn't built with Rust 1.17. * Update the base64 dependency to ensure the version with a buffer overflow fix is used. * Update hyper-rustls to one that uses a version of Rustls that builds with Rust 1.17, and that uses *ring* 0.9+, to ensure there are no problems with accidentally linking multiple versions of *ring*, to make the build easier to set up (especially on Windows), and to keep things working once *ring* 0.7.* gets yanked. * Update the rust-openssl dependency while we're at it.
yup-oauth2 is a utility library which implements several OAuth 2.0 flows. It's mainly used by google-apis-rs, to authenticate against Google services. (However, you're able to use it with raw HTTP requests as well; the flows are implemented as token sources yielding HTTP Bearer tokens).
Supported authorization types
- Device flow (user enters code on authorization page)
- Installed application flow (user visits URL, copies code to application, application uses code to obtain token). Used for services like GMail, Drive, ...
- Service account flow: Non-interactive for server-to-server communication based on public key cryptography. Used for services like Cloud Pubsub, Cloud Storage, ...
Usage
Please have a look at the API landing page for all the examples you will ever need.
A simple commandline program which authenticates any scope and prints token information can be found in the examples directory.
The video below shows the auth example in action. It's meant to be used as utility to record all server communication and improve protocol compliance.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
