deny tickets with no claims required (closes a race condition)

pull/708/merge
Justin Richer 2015-03-31 10:26:06 -04:00
parent dc10779abb
commit f48049be4d
1 changed files with 5 additions and 3 deletions

View File

@ -139,6 +139,7 @@ public class AuthorizationRequestEndpoint {
Collection<Claim> claimsUnmatched = new HashSet<>(claimsRequired);
// see if each of the required claims has a counterpart in the supplied claims set
// TODO: move this component to a claims checking service (#796)
for (Claim required : claimsRequired) {
for (Claim supplied : claimsSupplied) {
@ -153,16 +154,17 @@ public class AuthorizationRequestEndpoint {
}
}
}
}
if (claimsUnmatched.isEmpty()) {
// note that if the required claims are empty we don't want to return a token
if (!claimsRequired.isEmpty() && claimsUnmatched.isEmpty()) {
// we matched all the claims, create and return the token
// TODO: move this whole mess to the OIDCTokenService
// TODO: move this whole mess to the OIDCTokenService (#797)
OAuth2Authentication o2auth = (OAuth2Authentication) auth;