# Set sessionExpiryTime and require user-authentication in adminAuth

**URL:** <https://discourse.nodered.org/t/set-sessionexpirytime-and-require-user-authentication-in-adminauth/22518>\
**Category:** General\
**Created:** [2 March 2020 18:21 UTC](https://discourse.nodered.org/t/set-sessionexpirytime-and-require-user-authentication-in-adminauth/22518 "2020-03-02T18:21:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [2 March 2020 18:21 UTC](https://discourse.nodered.org/t/set-sessionexpirytime-and-require-user-authentication-in-adminauth/22518/1 "2020-03-02T18:21:38Z")

</div>

Hi All,

I'm trying to put the two properties in adminAuth in settings.js described at:

[https://nodered.org/docs/user-guide/runtime/securing-node-red#token-expiration](https://nodered.org/docs/user-guide/runtime/securing-node-red#token-expiration)

i.e.:  
adminAuth: { sessionExpiryTime: 86400, ... }

and

[https://nodered.org/docs/user-guide/runtime/securing-node-red#custom-user-authentication](https://nodered.org/docs/user-guide/runtime/securing-node-red#custom-user-authentication)

i.e.: adminAuth: require("./user-authentication")

I came up with this, but it did not work out:

adminAuth: { sessionExpiryTime: 3600, module: require("./user-authentication") }

Thanks for any hints,  
r0ller

---

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [2 March 2020 18:38 UTC](https://discourse.nodered.org/t/set-sessionexpirytime-and-require-user-authentication-in-adminauth/22518/2 "2020-03-02T18:38:48Z")

</div>

Just for the record: had to put sessionExpiryTime in the user-authentication.js itself and now it works:D

---

<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:** [1 May 2020 18:38 UTC](https://discourse.nodered.org/t/set-sessionexpirytime-and-require-user-authentication-in-adminauth/22518/3 "2020-05-01T18:38:49Z")

</div>

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