Skip to content

Commit

Permalink
feat(jans-auth-server): added read response modification method
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Jan 20, 2022
1 parent 74bbe38 commit ec8864b
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,27 @@ public boolean modifyPutResponse(JSONObject responseAsJsonObject, ExecutionConte
}
return false;
}

public boolean modifyReadResponse(JSONObject responseAsJsonObject, ExecutionContext context) {
CustomScriptConfiguration script = defaultExternalCustomScript;

try {
if (log.isTraceEnabled()) {
log.trace("Executing python 'modifyReadResponse' method, script name: {}, context: {}, response: {}", script.getName(), context, responseAsJsonObject.toString());
}
context.setScript(script);

ClientRegistrationType type = (ClientRegistrationType) script.getExternalType();
final boolean result = type.modifyReadResponse(responseAsJsonObject, context);
if (log.isTraceEnabled()) {
log.trace("Finished 'modifyReadResponse' method, script name: {}, context: {}, result: {}, response: {}", script.getName(), context, result, responseAsJsonObject.toString());
}

return result;
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
saveScriptError(script.getCustomScript(), ex);
}
return false;
}
}

0 comments on commit ec8864b

Please sign in to comment.