Two-factor
bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
password?stringUser password
Successful response
application/json- response
totpURI?stringcurl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/get-totp-uri' \ -H 'Content-Type: application/json' \ -d '{}'{ "totpURI": "string"}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
code*stringThe otp code to verify. Eg: "012345"
trustDevice?booleanIf true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time. Eg: true
Successful response
application/json- response
status?booleancurl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/verify-totp' \ -H 'Content-Type: application/json' \ -d '{ "code": "string"}'{ "status": true}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
trustDevice?booleanSuccessful response
application/json- response
status?booleancurl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/send-otp' \ -H 'Content-Type: application/json' \ -d '{}'{ "status": true}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
code*stringThe otp code to verify. Eg: "012345"
trustDevice?booleanTwo-factor OTP verified successfully
application/json- response
token*stringSession token for the authenticated session
user*The authenticated user object
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/verify-otp' \ -H 'Content-Type: application/json' \ -d '{ "code": "string"}'{ "token": "string", "user": { "id": "string", "email": "user@example.com", "emailVerified": true, "name": "string", "image": "http://example.com", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
code*stringA backup code to verify. Eg: "123456"
disableSession?booleanIf true, the session cookie will not be set.
trustDevice?booleanIf true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time. Eg: true
Backup code verified successfully
application/json- response
user*The authenticated user object with two-factor details
session*The current session object, included unless disableSession is true
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/verify-backup-code' \ -H 'Content-Type: application/json' \ -d '{ "code": "string"}'{ "user": { "id": "string", "email": "user@example.com", "emailVerified": true, "name": "string", "image": "http://example.com", "twoFactorEnabled": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }, "session": { "token": "string", "userId": "string", "createdAt": "2019-08-24T14:15:22Z", "expiresAt": "2019-08-24T14:15:22Z" }}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
password?stringThe users password.
Backup codes generated successfully
application/json- response
status*trueIndicates if the backup codes were generated successfully
truebackupCodes*array<string>Array of generated backup codes in plain text
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/generate-backup-codes' \ -H 'Content-Type: application/json' \ -d '{}'{ "status": true, "backupCodes": [ "string" ]}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
password?stringUser password
method?string"otp""totp"issuer?stringCustom issuer for the TOTP URI
Successful response
application/json- response
method*stringThe 2FA method that was enabled.
"otp""totp"totpURI?stringTOTP URI for authenticator app setup. Only present when method is 'totp'.
backupCodes?array<string>Recovery backup codes. Only present when method is 'totp'.
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/enable' \ -H 'Content-Type: application/json' \ -d '{}'{ "method": "otp", "totpURI": "string", "backupCodes": [ "string" ]}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
password?stringUser password
Successful response
application/json- response
status?booleancurl -X POST 'https://dev.auth.graphxserver.io/api/auth/two-factor/disable' \ -H 'Content-Type: application/json' \ -d '{}'{ "status": true}