Generate TOTP code Version 1 (python)
Action group: General
Description
The action generate a code to pass two-factor authentication
Action icon
Parameters
Input parameters
Secret key - secret key, which is taken from the service where authentication is to take place. The code will be generated based on this key. Only digits and letters of the Latin alphabet are allowed in the key. The key must match the selected format.
Secret key format - is a commonly used format for recording the secret key, which depends on the service type where authentication takes place. There are 2 options to choose from: base64, hexadecimal. The default value is “base64”.
Hash algorithm - data encryption method, which depends on the service type. There are 3 options to choose from: SHA-1, SHA-256, SHA-512. The default value is “SHA-1”.
Timeout (ms) - time during which the generated code is relevant. It is indicated in milliseconds. The minimum permissible value is “1000”. The default value is “30000”.
Code length - length of the code that will be generated as a result. The allowed value is between 1 and 10. The default value is “6”.
Output parameters
Generated code - generated code intended for pass authentication.
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Secret key | Secret key, which is taken from the service. | Robin.String | Yes | |
Secret key format | The format of the secret key, which depends on the type of service. | Robin.String | No | |
Hash algorithm | Data encryption method, which depends on the type of service. | Robin.String | No | |
Timeout (ms) | Time in milliseconds during which the generated code is relevant. | Robin.Numeric | No | |
Сode length | Generated code length. | Robin.Numeric | No | |
Results | ||||
Generated code | Generated code intended for pass authentication. | Robin.String |
Special conditions of use
In most cases, the default values of parameters are relevant. Selection of other parameter values and code generation based on them depends entirely on the service for which code generation is performed.
Example of use
Task
Authenticate in the portal of state services.
Solution
Use the "Generate TOTP code" action.
Implementation
Move the "Generate TOTP code" action to the workspace.
Set the "Generate TOTP code" action parameters:
Set the secret key.
Set the "Secret key format " to Base32.
Move the "Open browser" action to the workspace.
Move the "Get active URL" action to the workspace.
- Set the "Get active URL" action parameters:
- In the "Context" field specify the context obtained by the "Open browser" action.
- In the "Page URL" set the URL of the authorization in the state services portal - "https://esia.gosuslugi.ru/login/".
- Move the "Send text" action to the workspace.
- Set the "Send text" action parameters:
- In the "Context" field specify the context obtained by the "Open browser" action.
- In the "Element" field set the login input field.
- In the "Text" field set the state services portal login.
- Move the "Send text" action to the workspace.
- Set the "Send text" action parameters:
- In the "Context" field specify the context obtained by the "Open browser" action.
- In the "Element" field set the password input field.
- In the "Text" field set the state services portal password.
- Move the "Send click" action to the workspace.
- Заполнить параметры действия "Send click":
- В поле "Context" указать контекст, полученный действием "Open browser".
- В поле "Element" указать кнопку входа.
- В поле "Click event type" указать "left click".
- Move the "Keyboard input" action to the workspace.
- Set the "Keyboard input" action parameters:
- In the "Text" field set the "Generate TOTP code" action result.
- Click "Start" in the top panel.
Result
The program robot completed successfully.
The authentification on the state services portal was completed with the one-time TOTP code.
Generated code: 836762