How to mask password input?

Suppose the SAIL form has password fields (type and re-type password).
We know Appian doesn't have Password field, so we have to use text field for the user to enter password. The problem is that the text field will not be masked, which is a security violation.

I searched the forum, rogerp63 has some solution by using:

refreshAfter: "KEYPRESS",
value:joinarray(repeat(len(local!password), "*"), ""),

I tried it and the text will only be masked after you leave the field, so the password will still be visible while you are typing.

Another problem is when you go back to the text field, then the original text will get lost. This will cause lots of confusion.

Anyone has a better solution? Thanks.

OriginalPostID-178690

OriginalPostID-178690

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    We have some limitation, but we can do by this and check the below code 

    Encrypting and decrypting a value from a user

    a!localVariables(
      local!secret,
      {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!encryptedTextField(
                  label: "Input",
                  instructions: "Enter a secret here",
                  masked: true,
                  value: local!secret,
                  saveInto: local!secret,
                  refreshAfter: "KEYPRESS"
                )
              }
            ),
            a!columnLayout(
              contents: {
                a!encryptedTextField(
                  label: "Output",
                  instructions: "The value is displayed here",
                  value: local!secret,
                  readOnly: true
                )
              }
            )
          }
        )
      }
    )

Reply
  • 0
    Certified Senior Developer

    We have some limitation, but we can do by this and check the below code 

    Encrypting and decrypting a value from a user

    a!localVariables(
      local!secret,
      {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!encryptedTextField(
                  label: "Input",
                  instructions: "Enter a secret here",
                  masked: true,
                  value: local!secret,
                  saveInto: local!secret,
                  refreshAfter: "KEYPRESS"
                )
              }
            ),
            a!columnLayout(
              contents: {
                a!encryptedTextField(
                  label: "Output",
                  instructions: "The value is displayed here",
                  value: local!secret,
                  readOnly: true
                )
              }
            )
          }
        )
      }
    )

Children
No Data