# In config setting make a field "password type"

**URL:** <https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757>\
**Category:** Ignition\
**Created:** [October 16, 2020, 3:25pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757 "2020-10-16T15:25:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpervaiz](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mpervaiz](https://forum.inductiveautomation.com/u/mpervaiz)\
**Post date:** [October 16, 2020, 3:25pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/1 "2020-10-16T15:25:37Z")

</div>

for my module settings page (in config) I want to make one of the text fields a password field. Is that possible?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 16, 2020, 3:28pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/2 "2020-10-16T15:28:38Z")

</div>

Use `EncodedStringField` instead of `StringField`.

Then in a static block or wherever you can configure a different editor:

```auto
Password.getFormMeta().setEditorSource(PasswordEditorSource.getSharedInstance());

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 16, 2020, 3:31pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/3 "2020-10-16T15:31:53Z")

</div>

There’s also `SinglePasswordEditorSource.getSharedInstance()`, which nothing appears to use but I assume it does work…

The difference is that the `PasswordEditorSource` uses 2 fields that must have the same value entered by the user. This is for when you are setting up the expected value of password for something.

The single field version is more appropriate when you’re entering the password for a remote system and a typo will not result in setting up a password you don’t know the value for any more.

Unfortunately it doesn’t appear anything in Ignition uses the single field version even if it would be more appropriate…

---

<div class="post-metadata">

**Author:** ![mpervaiz](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mpervaiz](https://forum.inductiveautomation.com/u/mpervaiz)\
**Post date:** [October 16, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/4 "2020-10-16T18:10:00Z")

</div>

Thanks so much this worked

---

<div class="post-metadata">

**Author:** ![mpervaiz](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mpervaiz](https://forum.inductiveautomation.com/u/mpervaiz)\
**Post date:** [October 21, 2020, 12:03pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/5 "2020-10-21T12:03:00Z")

</div>

Follow up: In my config-\> module settings, the password field is always empty, so if I make a change to any other setting on that page and click save it throws an error that password field isn’t there. However, I don’t want my users to have to enter the password everytime they are making a change to any other setting.

How can i change this?

Cheers!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 21, 2020, 12:34pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/6 "2020-10-21T12:34:35Z")

</div>

Did you use the SinglePasswordEditorSource or the normal one?

---

<div class="post-metadata">

**Author:** ![mpervaiz](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mpervaiz](https://forum.inductiveautomation.com/u/mpervaiz)\
**Post date:** [October 21, 2020, 1:18pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/7 "2020-10-21T13:18:46Z")

</div>

I used SinglePasswordEditorSource.

```auto
public static final EncodedStringField LocalAdminPassword = new EncodedStringField(META, "local_admin_password", SFieldFlags.SMANDATORY).setDefault("secure_password");
    static {
        LocalAdminPassword.getFormMeta().setEditorSource(SinglePasswordEditorSource.getSharedInstance());
    }

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 21, 2020, 1:21pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/8 "2020-10-21T13:21:35Z")

</div>

Can you try it with the normal one? I think perhaps the reason the SinglePasswordEditorSource is not used anywhere is because it is broken in the way that you are seeing…

---

<div class="post-metadata">

**Author:** ![mpervaiz](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mpervaiz](https://forum.inductiveautomation.com/u/mpervaiz)\
**Post date:** [October 27, 2020, 6:34pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/9 "2020-10-27T18:34:16Z")

</div>

I tried it. It showed up as two fields with the field label as Password, as opposed to a different label i am using

---

<div class="post-metadata">

**Author:** ![Wylie](https://avatars.discourse-cdn.com/v4/letter/w/958977/32.png) [@Wylie](https://forum.inductiveautomation.com/u/Wylie)\
**Post date:** [June 27, 2022, 6:05pm UTC](https://forum.inductiveautomation.com/t/in-config-setting-make-a-field-password-type/39757/10 "2022-06-27T18:05:25Z")

</div>

I’m faced with this same issue - I don’t want my users to have to retype multiple long server keys (with the PasswordEditorSource), but I can’t get them to save, and reappear using SinglePasswordEditorSource. Any updates or advice on this one?
