Google Sign-In for Rust
Rust API bindings for Google Sign-in.
See authenticating with a backend server.
Usage
Put this in your Cargo.toml
:
[]
= "0.2.1"
And this in your crate root:
extern crate google_signin;
And then you can verify a google JSON web token
use google_signin;
let mut client = new;
client.audiences.push; // recommended
client.hosted_domains.push; // optional
// Let the crate handle everything for you
let id_info = client.verify.expect;
println!;
// Inspect the ID before verifying it
let id_info = client.get_unsafe.expect;
let ok = id_info.verify.is_ok;
println!;