# Input prompt for MFA in adminAuth - Node-RED user authentication

**URL:** https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669
**Category:** General
**Created:** [3 June 2021 20:39 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669 "2021-06-03T20:39:06Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![mahmoudp](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mahmoudp](https://discourse.nodered.org/u/mahmoudp)
#### Post date: [3 June 2021 20:39 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/1 "2021-06-03T20:39:06Z")

</div>

Hello,

I'm setting up a user authenticator for Node-RED that uses the authAdmin and a user-authentication.js module. When authenticating, I'm passing username and password to an external identity provider to verify the credentials. In addition to username and password, I would need to ask the user to enter a MFA code when needed. How can I have a prompt/dialog to have an input field for the user to enter the code?

Thanks

---

<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: [4 June 2021 21:17 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/2 "2021-06-04T21:17:36Z")

</div>

How are you asking the user for their id/pw?

---

<div class="post-metadata">

### Author: ![mahmoudp](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mahmoudp](https://discourse.nodered.org/u/mahmoudp)
#### Post date: [4 June 2021 21:54 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/3 "2021-06-04T21:54:39Z")

</div>

Through the regular NodeRED login screen, but I'm checking for authentication/authorization with a custom function passed to adminAuth similar to the instructions here:  
[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)

---

<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: [4 June 2021 22:05 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/4 "2021-06-04T22:05:04Z")

</div>

@mahmoudp is it a public service you're trying to connect to? Can you share more details?

There's no way to prompt the user for an MFA code via the `credentials` auth scheme. It _might_ be possible using the passport-strategy option - depending on the specific details of the service you are using.

---

<div class="post-metadata">

### Author: ![mahmoudp](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mahmoudp](https://discourse.nodered.org/u/mahmoudp)
#### Post date: [4 June 2021 22:38 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/5 "2021-06-04T22:38:34Z")

</div>

@knolleary absolutely, I'm trying to authenticate multiple servers through our user pool in AWS Cognito.

As for a passport-strategy, I have tried OAuth2 with passport and everything works great. However, since I'll be having many of these NodeRED servers (with different host/dns configurations), I would need to automate registering OAuth2 callback urls in Cognito when spinning up the servers and Cognito supports only a limited number of apps and callback-urls.

If there's no simple option to add MFA to the default (credentials) authentication scheme, do you know of any other passport-strategy that could solve this?

---

<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: [5 June 2021 12:47 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/6 "2021-06-05T12:47:13Z")

</div>

A quick search shows a number of possibilities that I'm afraid you will need to wade through. If your MFA uses TOTP, it may be relatively straight forward. However, I'm not familiar with AWS MFA I'm afraid.

---

<div class="post-metadata">

### Author: ![mahmoudp](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mahmoudp](https://discourse.nodered.org/u/mahmoudp)
#### Post date: [6 June 2021 19:35 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/7 "2021-06-06T19:35:41Z")

</div>

Sounds good, I'll see if there's any possible solution in Passport for this purpose.

---

<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: [5 August 2021 19:36 UTC](https://discourse.nodered.org/t/input-prompt-for-mfa-in-adminauth-node-red-user-authentication/46669/8 "2021-08-05T19:36:30Z")

</div>

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