Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/main/java/uk/ac/ox/ctl/ltiauth/JWTService.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public JWTService(JWTSigner signer, JWTStore store, LtiSettings ltiSettings) {
*/
public String createJWT(OAuth2AuthenticationToken token, String toolSupportUrl) {
JWTClaimsSet.Builder builder = new JWTClaimsSet.Builder();
checkForNullCustomValues(token);
token.getPrincipal().getAttributes().forEach(builder::claim);
builder
// Save the original issuer, this is needed for deep linking where we need to know who the audience is.
Expand All @@ -49,21 +48,6 @@ public String createJWT(OAuth2AuthenticationToken token, String toolSupportUrl)
throw new BadCredentialsException("Failed to create new JWT");
}
}

void checkForNullCustomValues(OAuth2AuthenticationToken token) {
// Checks if any of the launches we handle currently get a null value
// This is only needed for a short time while we are checking if there's anything we should be looking
// at. Once Canvas has released the change to production we can remove this as we will be seeing the
// errors.
Object claim = token.getPrincipal().getAttribute("https://purl.imsglobal.org/spec/lti/claim/custom");
if (claim instanceof Map custom) {
custom.forEach((key, value) -> {
if (value == null) {
log.error("Custom attribute {} is null for client registration ID: {}", key, token.getAuthorizedClientRegistrationId());
}
});
}
}

public String store(Object token) {
return store.store(token);
Expand Down
50 changes: 0 additions & 50 deletions src/test/java/uk/ac/ox/ctl/ltiauth/JWTServiceTest.java

This file was deleted.