{ "opencollection": "1.0.0", "info": { "name": "ThingsBoard Admin admin-controller two-factor-auth-config-controller API", "version": "4.3.0.3DEMO" }, "items": [ { "info": { "name": "two-factor-auth-config-controller", "type": "folder" }, "items": [ { "info": { "name": "Verify and Save 2FA Account Config (verifyAndSaveTwoFaAccountConfig)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/2fa/account/config", "params": [ { "name": "verificationCode", "value": "", "type": "query" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Checks the verification code for submitted config, and if it is correct, saves the provided account config. \n\nReturns whole account's 2FA settings object.\nWill throw an error (Bad Request) if the provider is not configured for usage. \n\nAvailable for any authorized user. " }, { "info": { "name": "Update 2FA Account Config (updateTwoFaAccountConfig)", "type": "http" }, "http": { "method": "PUT", "url": "https://demo.thingsboard.io/api/2fa/account/config", "params": [ { "name": "providerType", "value": "", "type": "query" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Update config for a given provider type. \nUpdate request example:\n```\n{\n \"useByDefault\": true\n}\n```\nReturns whole account's 2FA settings object.\n\n\nAvailable for any authorized user. " }, { "info": { "name": "Delete 2FA Account Config (deleteTwoFaAccountConfig)", "type": "http" }, "http": { "method": "DELETE", "url": "https://demo.thingsboard.io/api/2fa/account/config", "params": [ { "name": "providerType", "value": "", "type": "query" } ] }, "docs": "Delete 2FA config for a given 2FA provider type. \nReturns whole account's 2FA settings object.\n\n\nAvailable for any authorized user. " }, { "info": { "name": "Get Platform 2FA Settings (getPlatformTwoFaSettings)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/2fa/settings" }, "docs": "Get platform settings for 2FA. The settings are described for savePlatformTwoFaSettings API method. If 2FA is not configured, then an empty response will be returned.\n\nAvailable for users with 'SYS_ADMIN' or 'TENANT_ADMIN' authority." }, { "info": { "name": "Save Platform 2FA Settings (savePlatformTwoFaSettings)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/2fa/settings", "body": { "type": "json", "data": "{}" } }, "docs": "Save 2FA settings for platform. The settings have following properties:\n- `providers` - the list of 2FA providers' configs. Users will only be allowed to use 2FA providers from this list. \n\n- `minVerificationCodeSendPeriod` - minimal period in seconds to wait after verification code send request to send next request. \n- `verificationCodeCheckRateLimit` - rate limit configuration for verification code checking.\nThe format is standard: 'amountOfRequests:periodInSeconds'. The value of '1:60' would " }, { "info": { "name": "Submit 2FA Account Config (submitTwoFaAccountConfig)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/2fa/account/config/submit", "body": { "type": "json", "data": "{}" } }, "docs": "Submit 2FA account config to prepare for a future verification. Basically, this method will send a verification code for a given account config, if this has sense for a chosen 2FA provider. This code is needed to then verify and save the account config.\n\nExample of EMAIL 2FA account config:\n```\n{\n \"providerType\": \"EMAIL\",\n \"useByDefault\": true,\n \"email\": \"separate-email-for-2fa@thingsboard.org\"\n}\n```\n\nExample of SMS 2FA account config:\n```\n{\n \"providerType\": \"SMS\",\n \"useByDefault\": false,\n " }, { "info": { "name": "Generate 2FA Account Config (generateTwoFaAccountConfig)", "type": "http" }, "http": { "method": "POST", "url": "https://demo.thingsboard.io/api/2fa/account/config/generate", "params": [ { "name": "providerType", "value": "", "type": "query", "description": "2FA provider type to generate new account config for" } ] }, "docs": "Generate new 2FA account config template for specified provider type. \n\nFor TOTP, this will return a corresponding account config template with a generated OTP auth URL (with new random secret key for each API call) that can be then converted to a QR code to scan with an authenticator app. Example:\n```\n{\n \"providerType\": \"TOTP\",\n \"useByDefault\": false,\n \"authUrl\": \"otpauth://totp/TB%202FA:tenant@thingsboard.org?issuer=TB+2FA&secret=PNJDNWJVAK4ZTUYT7RFGPQLXA7XGU7PX\"\n}\n```\n\nFor EMAIL, the gener" }, { "info": { "name": "Get Available 2FA Providers (getAvailableTwoFaProviders)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/2fa/providers" }, "docs": "Get the list of provider types available for user to use (the ones configured by tenant or sysadmin).\nExample of response:\n```\n[\n \"TOTP\",\n \"EMAIL\",\n \"SMS\"\n]\n```\n\nAvailable for any authorized user. " }, { "info": { "name": "Get Account 2FA Settings (getAccountTwoFaSettings)", "type": "http" }, "http": { "method": "GET", "url": "https://demo.thingsboard.io/api/2fa/account/settings" }, "docs": "Get user's account 2FA configuration. Configuration contains configs for different 2FA providers.\n\nExample:\n```\n{\n \"configs\": {\n \"EMAIL\": {\n \"providerType\": \"EMAIL\",\n \"useByDefault\": true,\n \"email\": \"tenant@thingsboard.org\"\n },\n \"TOTP\": {\n \"providerType\": \"TOTP\",\n \"useByDefault\": false,\n \"authUrl\": \"otpauth://totp/TB%202FA:tenant@thingsboard.org?issuer=TB+2FA&secret=P6Z2TLYTASOGP6LCJZAD24ETT5DACNNX\"\n },\n \"SMS\": {\n \"providerType\": \"SMS\",\n \"u" } ] } ], "bundled": true }