Skip to content

Commit

Permalink
feat(jans-auth-server): added put response modification method
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Jan 19, 2022
1 parent db936f9 commit 00a24f2
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,27 @@ public boolean modifyPostResponse(JSONObject responseAsJsonObject, ExecutionCont
}
return false;
}

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

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

ClientRegistrationType type = (ClientRegistrationType) script.getExternalType();
final boolean result = type.modifyPutResponse(responseAsJsonObject, context);
if (log.isTraceEnabled()) {
log.trace("Finished 'modifyPutResponse' 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 00a24f2

Please sign in to comment.