Skip to content

Commit 2a9205e

Browse files
authored
Merge pull request #8 from djw8605/add-aud-critical
Force aud test in the validator
2 parents ada0c1e + 9baf649 commit 2a9205e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/scitokens_internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ class Enforcer {
369369
m_validator.add_claim_validator("aud", &Enforcer::aud_validator, this);
370370
m_validator.add_claim_validator("scope", &Enforcer::scope_validator, this);
371371
std::vector<std::string> critical_claims = {"scope"};
372+
373+
// If any audiences are in the given to us, then force the validator to check it.
374+
if (!m_audiences.empty()) {
375+
critical_claims.push_back("aud");
376+
}
372377
m_validator.add_critical_claims(critical_claims);
373378
}
374379

0 commit comments

Comments
 (0)