# Parse and validate Google JWT tokens within Rust WebAssembly
Developed for CloudFlare Workers. Experimental & non-reviewed. Use at own risk.
```
#[derive(Debug, Serialize, Deserialize)]
pub struct Token {
pub email: String,
pub aud: String,
pub iss: String,
pub exp: u64,
}
async fn main() {
let parser = Parser::new("your-google-client-id");
let claims = parser.parse::<Token>("your-token", Instant::now()).await.unwrap();
// Instant::now() is not supported on Cloudflare workers and needs to be replaced.
}
```
## Credits
Based upon [avkviring/jsonwebtoken-google](https://github.com/avkviring/jsonwebtoken-google) which can't target WASM due to a `rand` crate dependency.