#google #oauth #v2

yup-oauth2

An oauth2 implementation, providing the ‘device’, ‘service account’ and ‘installed’ authorization flows

59 releases (20 stable)

✓ Uses Rust 2018 edition

3.1.1 Sep 29, 2019
3.0.2-beta Jul 10, 2019
2.0.4 Aug 3, 2019
2.0.3 Jun 22, 2019
0.3.1 Mar 22, 2015

#1 in Authentication

Download history 1074/week @ 2019-07-17 891/week @ 2019-07-24 1273/week @ 2019-07-31 1118/week @ 2019-08-07 1796/week @ 2019-08-14 1533/week @ 2019-08-21 1446/week @ 2019-08-28 1676/week @ 2019-09-04 1726/week @ 2019-09-11 1910/week @ 2019-09-18 1200/week @ 2019-09-25 1468/week @ 2019-10-02 1051/week @ 2019-10-09 1195/week @ 2019-10-16 1170/week @ 2019-10-23

5,635 downloads per month
Used in 446 crates

MIT/Apache

150KB
3K SLoC

Build Status codecov crates.io

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).

The provider we have been testing the code against is also Google. However, the code itself is generic, and any OAuth provider behaving like Google will work as well. If you find one that doesn't, please let us know and/or contribute a fix!

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 authorization of 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.

usage

Versions

Version 1.x for Hyper versions bellow 12 Version 2.x for Hyper versions 12 and above

License

Licensed under either of

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.

Dependencies

~14MB
~356K SLoC