# Problem authentication

**URL:** <https://discourse.nodered.org/t/problem-authentication/82759>\
**Category:** General\
**Tags:** security\
**Created:** [10 November 2023 12:56 UTC](https://discourse.nodered.org/t/problem-authentication/82759 "2023-11-10T12:56:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdero](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@gdero](https://discourse.nodered.org/u/gdero)\
**Post date:** [10 November 2023 12:56 UTC](https://discourse.nodered.org/t/problem-authentication/82759/1 "2023-11-10T12:56:34Z")

</div>

Hello,  
I have configured my Nodered with login/password  
The first time i connect , Nodered ask me Login/Password , it is ok  
But for the next connection it ask nothing and connect directly  
Thanks for your help  
gdero

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [10 November 2023 12:59 UTC](https://discourse.nodered.org/t/problem-authentication/82759/2 "2023-11-10T12:59:48Z")

</div>

Hi @gdero - Welcome to the forums.

Is this with the same browser?

if so, it is entirely normal, logins have an expiry (I cant remember the default time).  
but if you want to kill the logon session - you need to logout (top right), or wait until it expires

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [10 November 2023 14:22 UTC](https://discourse.nodered.org/t/problem-authentication/82759/3 "2023-11-10T14:22:33Z")

</div>

This can be configured in the settings file

```auto
sessionExpiryTime: 604800, // in secs, default 7d=604800

```

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [10 November 2023 14:25 UTC](https://discourse.nodered.org/t/problem-authentication/82759/4 "2023-11-10T14:25:38Z")

</div>

Thats it!

I knew it was there, but couldn't remember the default value!

---

<div class="post-metadata">

**Author:** ![gdero](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@gdero](https://discourse.nodered.org/u/gdero)\
**Post date:** [10 November 2023 17:48 UTC](https://discourse.nodered.org/t/problem-authentication/82759/5 "2023-11-10T17:48:25Z")

</div>

Thank you for your answer

However ,I have no parameter "sessionExpiryTime " in my setting.js ; i have tried to add it at the end of my file but i get an error when launching nodered !!!!

Thanks

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [10 November 2023 17:53 UTC](https://discourse.nodered.org/t/problem-authentication/82759/6 "2023-11-10T17:53:10Z")

</div>

The settings file is a Javascript file so you have to add sections using JS syntax.  
If you what help adding it, an example of where and how you added it would be required to see where you went wrong.

This topic may help you

> [@Annotated settings.js](https://discourse.nodered.org/t/annotated-settings-js/37928/1):
>
> Been meaning to share this for a while. This is a sanitised version of my settings.js file. There are a few potential advantages over the stock version - use or abuse as you like smiley Annotated - using JSDoc comments rather than the originals where possible - this greatly improves readability, especially when using a decent code editor such as VScode. Some annotation regions also included - supporting code editors will let you collapse these regions which can make working on the file a lo…

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [10 November 2023 17:53 UTC](https://discourse.nodered.org/t/problem-authentication/82759/7 "2023-11-10T17:53:42Z")

</div>

Hi @gdero,

You will add this in the same place you added the auth details.

```auto
adminAuth: {
   type: "credentials",
   sessionExpiryTime: 86400, /* Here */
   users: [{
       ....
   }]
},

```

Don't forget to restart Node RED

All info here:  
[https://nodered.org/docs/user-guide/runtime/securing-node-red](https://nodered.org/docs/user-guide/runtime/securing-node-red)

---

<div class="post-metadata">

**Author:** ![gdero](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@gdero](https://discourse.nodered.org/u/gdero)\
**Post date:** [10 November 2023 18:42 UTC](https://discourse.nodered.org/t/problem-authentication/82759/8 "2023-11-10T18:42:22Z")

</div>

Thank you for your help

---

<div class="post-metadata">

**Author:** ![gdero](https://avatars.discourse-cdn.com/v4/letter/g/848f3c/32.png) [@gdero](https://discourse.nodered.org/u/gdero)\
**Post date:** [10 November 2023 18:43 UTC](https://discourse.nodered.org/t/problem-authentication/82759/9 "2023-11-10T18:43:24Z")

</div>

thank you for your help .

---

<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:** [9 January 2024 18:43 UTC](https://discourse.nodered.org/t/problem-authentication/82759/10 "2024-01-09T18:43:30Z")

</div>

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