Node.js Two-Factor Authentication

I am working on a personal program using node.js, which specifically uses authentication for the Steam application. The login reads the username and password from an external .txt file, and it works using array positioning, divided by :: (colon). Now I need help. With some accounts, Steam uses a two-factor code that is randomly generated by time in a mobile application or by email. At the moment I have my program, so it checks if the account is activated by the account, and if it is, I will ask you to manually enter the corresponding factor code. I know there is a way to enable my program to pull this authentication code and put it without the user having to do it manually, but I don’t know where to start.

Problem: I want the program to pull out randomly generated code and automatically install it without having to do anything manually.

The code is as follows:

else if (eresult === Steam.EResult.AccountLoginDeniedNeedTwoFactor)
 {
    login.two_factor_code = readline.question(`[${param[0]}] Mobile auth code: `);
    client.disconnect();
    client.connect();
      }
else if (eresult === Steam.EResult.AccountLogonDenied) 
{
   login.auth_code = readline.question(`[${param[0]}] Steam Guard code: `);
   client.disconnect();
   client.connect();
}

Thank.

+4
source share
1 answer

Two-factor authentication (2FA) is the principle when you are authorized for a resource by two separate factors. 1. something that you know (login / password) 2. You have (a phone with a 2FA application installed, for example, Google Authenticator, Authy, I also think that there is an application for this made by Steam).

- 2FA . , , . , -. /, API Steam - .

API- - , , , , .. - . ( - API Steam, , , , )

+1

Source: https://habr.com/ru/post/1683905/


All Articles