Skip to content

Commit

Permalink
Removes asserts to avoid problems, adds logging for paranoia.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc3092 committed Feb 26, 2025
1 parent 2b9c829 commit 0e61064
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ private Optional<ResourceServerType> getResourceTypeForm(JwtAuthenticationToken
return resourceServerProperties
.stream()
.filter(properties -> {
log.info("Configured issuer: {}", properties.getIssuerUri());
assert token != null;
assert token.getToken() != null;
assert token.getToken().getIssuer() != null;
assert token.getToken().getIssuer().toString() != null;
log.info("Token issuer: {}", token.getToken().getIssuer().toString());
if (token == null) {
log.error("Token is null");
}
if (token.getToken() == null) {
log.error("Token.getToken() is null");
}
if (token.getToken().getIssuer() == null) {
log.error("Token.getToken().getIssuer() is null");
}
log.info("Configured issuer, token issuer: {}, {}", properties.getIssuerUri(), token.getToken().getIssuer().toString());
return properties
.getIssuerUri()
.equalsIgnoreCase(token.getToken().getIssuer().toString()); })
.getIssuerUri()
.equalsIgnoreCase(token.getToken().getIssuer().toString());
})
.findFirst()
.map(ResourceServerProperties::getType);
}
Expand Down

0 comments on commit 0e61064

Please sign in to comment.