Skip to content

Commit

Permalink
Audience is required with jsonwebtoken > 9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Timshel committed Nov 9, 2023
1 parent 0658403 commit 79a9127
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ fn prepare_decoding() -> (DecodingKey, Validation) {
validation.leeway = 30; // 30 seconds
validation.validate_exp = true;
validation.validate_nbf = true;
validation.set_audience(&[CONFIG.sso_client_id()]);
validation.set_issuer(&[CONFIG.sso_authority()]);

(key, validation)
}
None => {
let mut validation = jsonwebtoken::Validation::default();
validation.set_audience(&[CONFIG.sso_client_id()]);
validation.insecure_disable_signature_validation();

(DecodingKey::from_secret(&[]), validation)
Expand Down

0 comments on commit 79a9127

Please sign in to comment.