# Get logged user information in custom node

**URL:** <https://discourse.nodered.org/t/get-logged-user-information-in-custom-node/50796>\
**Category:** Developing Nodes\
**Created:** [9 September 2021 07:05 UTC](https://discourse.nodered.org/t/get-logged-user-information-in-custom-node/50796 "2021-09-09T07:05:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chiche](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chiche/32/35401_2.png) [@chiche](https://discourse.nodered.org/u/chiche)\
**Post date:** [9 September 2021 07:05 UTC](https://discourse.nodered.org/t/get-logged-user-information-in-custom-node/50796/1 "2021-09-09T07:05:16Z")

</div>

How can I get the information of the logged user at myNode.js

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 September 2021 15:43 UTC](https://discourse.nodered.org/t/get-logged-user-information-in-custom-node/50796/2 "2021-09-09T15:43:14Z")

</div>

It will depend on how you have implemented the user list.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [9 September 2021 15:52 UTC](https://discourse.nodered.org/t/get-logged-user-information-in-custom-node/50796/3 "2021-09-09T15:52:11Z")

</div>

Hi @chiche

it depends what exactly you are trying to do in `myNode.js`.

A node deployed in the runtime has no knowledge of the editor or any concept of users.

The only place you may have code in `myNode.js` that cares about editor users is if you have created a custom admin HTTP endpoint that gets called by the editor as part of your node's edit dialog.

In that context, as long as you include the `RED.auth.needsPermission` middleware, the `req.user` property should tell you who the user is calling the end point.

```auto
RED.httpAdmin.get("my-custom-node/do-something", RED.auth.needsPermission('XYZ.read'), function(req, res) {
   // req.user should identify the user.
});

```

---

<div class="post-metadata">

**Author:** ![chiche](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chiche/32/35401_2.png) [@chiche](https://discourse.nodered.org/u/chiche)\
**Post date:** [10 September 2021 11:02 UTC](https://discourse.nodered.org/t/get-logged-user-information-in-custom-node/50796/4 "2021-09-10T11:02:47Z")

</div>

Oh, I see. I was able to get the information, thanks a lot!

---

<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:** [24 September 2021 11:03 UTC](https://discourse.nodered.org/t/get-logged-user-information-in-custom-node/50796/5 "2021-09-24T11:03:29Z")

</div>

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