diff --git a/src/main/java/com/cloudbees/plugins/credentials/CredentialsSelectHelper.java b/src/main/java/com/cloudbees/plugins/credentials/CredentialsSelectHelper.java index 127beb026..cb9694d3c 100644 --- a/src/main/java/com/cloudbees/plugins/credentials/CredentialsSelectHelper.java +++ b/src/main/java/com/cloudbees/plugins/credentials/CredentialsSelectHelper.java @@ -611,7 +611,7 @@ public void doAddCredentials(StaplerRequest req, StaplerResponse rsp) throws IOE .generateResponse(req, rsp, null); } store.checkPermission(CredentialsStoreAction.CREATE); - Credentials credentials = req.bindJSON(Credentials.class, data.getJSONObject("credentials")); + Credentials credentials = Descriptor.bindJSON(req, Credentials.class, data.getJSONObject("credentials")); store.addCredentials(wrapper.getDomain(), credentials); FormApply.applyResponse("window.credentials.refreshAll();").generateResponse(req, rsp, null); } diff --git a/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java b/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java index d4d71c560..b752bfe21 100644 --- a/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java +++ b/src/main/java/com/cloudbees/plugins/credentials/CredentialsStoreAction.java @@ -811,7 +811,7 @@ public HttpResponse doCreateCredentials(StaplerRequest req) throws ServletExcept } } else { JSONObject data = req.getSubmittedForm(); - Credentials credentials = req.bindJSON(Credentials.class, data.getJSONObject("credentials")); + Credentials credentials = Descriptor.bindJSON(req, Credentials.class, data.getJSONObject("credentials")); getStore().addCredentials(domain, credentials); return HttpResponses.redirectTo("../../domain/" + getUrlName()); } @@ -1394,7 +1394,7 @@ public HttpResponse doDoMove(StaplerRequest req, @QueryParameter String destinat public HttpResponse doUpdateSubmit(StaplerRequest req) throws ServletException, IOException { getStore().checkPermission(UPDATE); JSONObject data = req.getSubmittedForm(); - Credentials credentials = req.bindJSON(Credentials.class, data); + Credentials credentials = Descriptor.bindJSON(req, Credentials.class, data); if (!getStore().updateCredentials(this.domain.domain, this.credentials, credentials)) { return HttpResponses.redirectTo("concurrentModification"); }