# How to decrypt and pass a credential value in custom node

**URL:** <https://discourse.nodered.org/t/how-to-decrypt-and-pass-a-credential-value-in-custom-node/74584>\
**Category:** Developing Nodes\
**Created:** [2 February 2023 05:59 UTC](https://discourse.nodered.org/t/how-to-decrypt-and-pass-a-credential-value-in-custom-node/74584 "2023-02-02T05:59:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [2 February 2023 05:59 UTC](https://discourse.nodered.org/t/how-to-decrypt-and-pass-a-credential-value-in-custom-node/74584/1 "2023-02-02T05:59:36Z")

</div>

In my custom node, I fetch the username and password which I have to pass to a function of **node-ansible** npm package to initiate an ansible playbook.

Since I have stored the password under credentials, a value **required: true** is getting passed instead of the actual password.

Is there any way I can pass the decrypted value of the password?

---

<div class="post-metadata">

**Author:** ![syedhannan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/syedhannan/32/72932_2.png) [@syedhannan](https://discourse.nodered.org/u/syedhannan)\
**Post date:** [2 February 2023 09:50 UTC](https://discourse.nodered.org/t/how-to-decrypt-and-pass-a-credential-value-in-custom-node/74584/2 "2023-02-02T09:50:45Z")

</div>

It was a silly error on my end.

At first, I had given a value to the password field.

While testing the node I cut-pasted the values from the password text field. So then the value of the text field changed to **required: true** (I guess because it was under credential) and as I was using the same instance of the node I didn't realise that such a thing could happen.

Got to know about it from reading this:

The `required: true` is a display feature in the Node-RED editor and is not part of the actual credential value. When a value is pasted into the credential field, Node-RED sets `required: true` to indicate that a value has been set for the field, even though it is not visible. This is just a visual indication that the field has value and it does not affect the functionality or security of the credential.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 February 2023 09:51 UTC](https://discourse.nodered.org/t/how-to-decrypt-and-pass-a-credential-value-in-custom-node/74584/3 "2023-02-16T09:51:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
