#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

#549 in Authentication

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

~23–37MB
~681K SLoC