#google #oauth #v2

yup-oauth2

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

44 releases (9 stable)

1.0.8 Jul 27, 2018
1.0.7 Mar 25, 2018
1.0.6 Jul 9, 2017
1.0.5 Feb 4, 2017
0.3.1 Mar 22, 2015

#3 in Authentication

Download history 166/week @ 2018-05-27 182/week @ 2018-06-03 101/week @ 2018-06-10 336/week @ 2018-06-17 253/week @ 2018-06-24 501/week @ 2018-07-01 531/week @ 2018-07-08 100/week @ 2018-07-15 246/week @ 2018-07-22 277/week @ 2018-07-29 742/week @ 2018-08-05 252/week @ 2018-08-12 133/week @ 2018-08-19

987 downloads per month
Used in 327 crates

MIT/Apache

139KB
1.5K SLoC

Build Status Coverage Status 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).

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.

usage

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

~10MB
~242K SLoC