From af0d3283d04dedcb48f0d8c5709cac63ea2d1ba3 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 21 Dec 2015 22:53:45 -0500 Subject: [PATCH] Add Google example --- examples/google.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 examples/google.rs diff --git a/examples/google.rs b/examples/google.rs new file mode 100644 index 0000000..1637d8f --- /dev/null +++ b/examples/google.rs @@ -0,0 +1,17 @@ +extern crate inth_oauth2; + +use inth_oauth2::client::Client; +use inth_oauth2::provider::Google; + +fn main() { + let client = Client::::new( + Default::default(), + "143225766783-ip2d9qv6sdr37276t77luk6f7bhd6bj5.apps.googleusercontent.com", + "3kZ5WomzHFlN2f_XbhkyPd3o", + Some("urn:ietf:wg:oauth:2.0:oob") + ); + + let auth_uri = client.auth_uri(Some("https://www.googleapis.com/auth/userinfo.email"), None) + .unwrap(); + println!("{}", auth_uri); +}