Keats / jsonwebtoken

JWT lib in rust
MIT License
1.61k stars 253 forks source link

[Bug] Error(MissingRequiredClaim("exp")) #348

Closed Baiyuetribe closed 7 months ago

Baiyuetribe commented 7 months ago

Env

jsonweb: latest

how to reproduce

    let mut validation = jwt::Validation::default();
    validation.validate_exp = false;

diasble exp check,then errors Error(MissingRequiredClaim("exp"))

more bug

image image

target

How do I disable exp authentication properly?

Keats commented 7 months ago

Not a bug report: see https://docs.rs/jsonwebtoken/latest/jsonwebtoken/struct.Validation.html#method.set_required_spec_claims

Baiyuetribe commented 7 months ago

How do I disable exp authentication properly? i tryed this image Still reporting errors: Error(MissingRequiredClaim("exp"))

Keats commented 7 months ago

That's not what I said: look at the example in https://docs.rs/jsonwebtoken/latest/jsonwebtoken/struct.Validation.html and https://github.com/Keats/jsonwebtoken/blob/master/src/validation.rs#L691-L693 for an example in a test

Baiyuetribe commented 7 months ago

thanks,it works~