Skip to content

Commit ac10042

Browse files
authored
Treat empty audience as equivalent to no audience (#350)
1 parent 0c6011d commit ac10042

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/validation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ pub(crate) fn validate(claims: ClaimsForValidation, options: &Validation) -> Res
321321
// processing the claim does not identify itself with a value in the
322322
// "aud" claim when this claim is present, then the JWT MUST be
323323
// rejected.
324+
(TryParse::Parsed(Audience::Multiple(aud)), None) => {
325+
if !aud.is_empty() {
326+
return Err(new_error(ErrorKind::InvalidAudience));
327+
}
328+
}
324329
(TryParse::Parsed(_), None) => {
325330
return Err(new_error(ErrorKind::InvalidAudience));
326331
}

0 commit comments

Comments
 (0)