Security and authentication
Components for confirmation codes, one-time passwords, request limits and OAuth 2.0.
On this page
Components for confirmation codes, one-time passwords, request limits and OAuth 2.0. This page holds the catalogue groups Security, API.
Each entry lists the inputs and outputs of the component, its main settings and the text of its readme. To add a component to a FlowStream, see Download components.
API
component
confirmation-code.html · version 1
Generates confirmation codes and verifies them.
confirmation-code.html · version 1| Parameter | Type | Description |
|---|---|---|
count? |
Number |
Count of attempts. Default: 3 |
type? |
String |
Type. Default: pin |
length? |
Number |
Length. Default: 4 |
expire? |
String |
Expiration. Default: 5 minutes |
lock? |
String |
Lock. |
limit? |
Number |
1 |
Inputs: create (Create), verify (Verify).
Outputs: output (Output).
This component can help you with generating confirmation codes. Keep data structure for inputs according to the documentation below.
create input/output
Create input:
id {String}identifier (email, phone number, identifier, etc.)param {String}a custom parameter
Create output:
success {Boolean}determines if the code is verified or not accroding to its identifiervalue {String}a pin/code/tokenparam {String}a custom parameter (it sends only if the value is true)error {String}(optional) a simple error identifier, it can contain:lockedthe identifier is locked by the previous call
verify input/output
Verify input:
id {String}identifier (email, phone number, identifier, etc.)value {String}a pin/code/token
Verify output:
success {Boolean}determines if the code is verified or not accroding to its identifierslots {Number}free slots/attemptserror {String}(optional) a simple error identifier, it can contain:invalidthe code is invalid404identifier not found
Settings
- Lock prevents overwriting of the code according to the identifier
component
iplimiter.html · version 1
Limits the number of requests per IP address.
iplimiter.html · version 1| Parameter | Type | Description |
|---|---|---|
count? |
Number |
1 |
timeout? |
Number |
Timeout in seconds. Default: 5 |
path? |
String |
Path to the IP address. Default: ip |
Inputs: input (Request).
Outputs: output (Allowed), error (Blocked).
This component limits the number of requests per IP address. The component first tries to obtain the IP address from the $.controller. If that doesn't work, it tries to load the IP address from the payload.
component
oauth2.html · version 1
Obtains an OAuth 2.0 access token from another service.
oauth2.html · version 1| Parameter | Type | Description |
|---|---|---|
urltoken? |
String |
Token URL. |
urlauthorize? |
String |
Authorize URL. |
variable? |
String |
Assign token to the global variable. |
clientid? |
String |
Client ID. |
clientsecret? |
String |
Client secret. |
scope? |
String |
Scope. |
accesstoken? |
String |
Access token. |
Inputs: none.
Outputs: none.
This component can obtain OAuth 2.0 access token from 3rd party service.
component
totp.html · version 1
Generates TOTP secrets and verifies one-time passwords for two-factor authorization.
totp.html · version 1| Parameter | Type | Description |
|---|---|---|
issuer? |
String |
Issuer. Default: Total.js |
time? |
Number |
Time. Default: 30 |
Inputs: generate (Generate), verify (Verify).
Outputs: output (Output).
Time-Based One-Time Password Algorithm
This component can generate a secret and verifies the code (generated via Authenticator app) as a one-time password for 2FA authorization.
- recommended mobile apps: Google Authenticator or Microsoft Authenticator
How does it work?
First, a user must generate a secret viagenerate input in the authenticator app. Then, for verification of the one-time generated password, you need to use the second input verify, which needs user secrets.
generate input/output
Input data:
user {String}email or user/account name without special characters
Output data object with:
secret {String}a generated secret which you must store for the specific userurl {String}an optimized url address for tokenizationqrcode {String}a link to the picture with QR code
verify input/outputs
Input data object with:
secret {String}
Output data object with:
success {Boolean}determines if the password is valid or not