#jwt #apple #google #token-parser #third-party #webtoken

id_token_parser

Parse and validate third party jwt token with jsonwebtoken

1 unstable release

0.2.0 Sep 22, 2024

#14 in #token-parser

Download history 161/week @ 2024-09-19 28/week @ 2024-09-26 5/week @ 2024-10-03 1/week @ 2024-10-10

195 downloads per month

MIT/Apache

32KB
787 lines

Parse and validate Google JWT tokens

#[derive(Debug, Serialize, Deserialize)]
pub struct TokenClaims {
    pub email: String,
    pub aud: String,
    pub iss: String,
    pub exp: u64,
}

async fn main() {
    let parser = Parser::new();
    parser.add_client_id("some-google-web-client-id");
    let claims = parser.parse::<TokenClaims>("some-token").await.unwrap();
}

Dependencies

~21–35MB
~660K SLoC