Sitelet https://github.com/hellosign/hellosign-java-sdk/issues/89
Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

TemplateSignatureRequest not allow to put signer accesscode #89

Description

@Marcocmd

I need to use embedded signing using a pdf template in my web application. I nees also to generate an "One Time Password" to protect access to the signing window. So i need to use TemplateSignatureRequest using a signer with an accesscode :
Signer client = new Signer();
client.setNameOrRole(name+" "+surname);
client.setAccessCode(otp);
signers.put("Client", client);

But then no access code is requested to sign the documet. I think there is a bug in TemplateSignatureRequest, so I extended it in my application with a new object "TemplateSignatureWithPinRequest" fixing it, but i need a confirm of it.

I added Pin code in getPostFields() method
public Map<String, Serializable> getPostFields() throws HelloSignException {
Map<String, Serializable> fields = super.getPostFields();
try {
// Mandatory fields
List templateIds = getTemplateIds();
for (int i = 0; i < templateIds.size(); i++) {
fields.put(TEMPLATE_IDS + "[" + i + "]", templateIds.get(i));
}
Map<String, Signer> signerz = getSigners();
for (String role : signerz.keySet()) {
Signer s = signerz.get(role);
fields.put(TEMPLATE_SIGNERS + "[" + role + "][" + TEMPLATE_SIGNERS_EMAIL + "]", s.getEmail());
fields.put(TEMPLATE_SIGNERS + "[" + role + "][" + TEMPLATE_SIGNERS_NAME + "]", s.getNameOrRole());
if (s.getAccessCode() != null) {
fields.put(TEMPLATE_SIGNERS + "[" + role + "][" + SIGREQ_SIGNER_PIN + "]", s.getAccessCode());
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlegacyRelated to legacy, non-OpenAPI SDK

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions