OTP - Initiation
TOTP Provisioning
The Time-based One-Time Password (TOTP) Provisioning API is used to create an OTP-based credential for a user. The server will generate a unique TOTP secret which can be used with an TOTP generation tool, like Google Authenticator. This API call will respond with a session ID, bearer token, and a challenge that includes the OTP secret. The user will have to complete this challenge by generating the OTP from their chosen authenticator app and submitting it to the VIDA API.
API Description
Method : GET
URL : https://{environment-url}/realms/{partner-id}/protocol/api/init
Parameters
client_id*
String
A unique client id that is shared for each partner.
client_secret*
String
A unique key that is generated for each product configured for the partner.
type*
String
Type of the authentication
Eg:
otp
{
"entity": {
"totpSecret": "kWueMqR0Ml70sv5FSB5F",
"totpSecretEncoded": "NNLX KZKN OFJD ATLM G4YH G5RV IZJU ENKG",
"totpSecretQrCode": "iVBORw0KGgoAAAANSUhEUgAAAPYAAAD2AQAAAADNaUdlAAACwElEQVR4Xu2XsW7kMAxE1emX3YmdfllFAN973GS96yLViUCAVRawzGFBcIZDp52/nq92j7yfD36PvJ8Pfo+8nz+BR2s939YxYkTrq435CJbgk18crUcb0WeMc67WDVbhRIlEj+MYc66+xuoGC/FoRz8ntzXmOhp5tXiGj0NSpjxlsAo3BWpOQ/Tn6HNmsAhXivN+bvq9w/8TzzNP1EF9j/j8jpbgkaOxhMPhhCb+0GoRDiPDseSxHhJhQJRoGY44HVE84jSvI5RgRsvwnAfQLI/ekMNLGX6mO1ClsvRGgWF7anAq0xZHWNewMohKmdbguAFs0B4SFOjIgi20Bs9m6Ep0CmI45g3fanDnkxyhlOnBkLZrPvbj6pML8hxnWoUL8qnP/TifJe6jYDyhJx67shDvr0NigS6MV3624hqToTPtOcmRrvipbzfOaOZfrgSI0agpbo0qnNZIEbbUcjzTp/pV324cJUwN2gcygRoiaZAl+DJkd1rKYjmoXC7+NuPWF1IjK9TnfcpaEZ569P1Bi+boufqzGZ/ZFOiZdooUO6Ziy3BcyYgQaawqHNOBrcFtTe5ov1CdFXfjS33bcUP6Ii6VcXeUzSrC+XeYFNWR3shFnuaLPvfilKMdk6QyKMsVbYeKcFpyNG3Z57Da6aruz/nZjHOsLDnCpDAKBAJlT/4243jjIEFGmBAHNPVahrMKdCSjI+fTa77U4MtKvocUZfh9SNoBXISjieZwwkxmRndin/60HVeU+EF2Rmy4KthQRXjkegwnIrVxZn29DPekG4bE2ChNIl7ncytuMfph90eldCey1CJ8+oOkcCSzRWojru+D3XhYnvOhTI+0Km+jElchTXM8fSCVee2PCjzHZNoV6cGrFUwRfurNbAd4eWxnW3XNx2481GfojD/W2E3lWoP/cj74PfJ+Pvg98n7+PP4PgcDV9o3EJH0AAAAASUVORK5CYII=",
"enabled": false,
"otpCredentials": [],
"supportedApplications": [
"totpAppMicrosoftAuthenticatorName",
"totpAppFreeOTPName",
"totpAppGoogleName"
],
"manualUrl": "https://{environment-url}/realms/{partner-id}/protocol/api/init?type=otp&client_id=api&client_secret=enESfot4PPpSWxTa74vR8D9nrW4UTtT3&mode=manual&execution=CONFIGURE_TOTP",
"qrUrl": "https://{environment-url}/realms/{partner-id}/protocol/api/init?type=otp&client_id=api&client_secret=enESfot4PPpSWxTa74vR8D9nrW4UTtT3&execution=CONFIGURE_TOTP&mode=qr",
"policy": {
"type": "totp",
"algorithm": "HmacSHA1",
"initialCounter": 0,
"digits": 6,
"lookAheadWindow": 1,
"period": 30,
"codeReusable": false,
"algorithmKey": "SHA1"
},
"username": "57978748-a5ae-4369-8b89-7bb461d964f2"
},
"uri": "https://{environment-url}/realms/{partner-id}/protocol/api/required-action",
"bearerToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI0ZDVlYzUzNy0xNjMxLTQ1ZjEtYmU2Zi0yZWQ5YmQwY2QzYzAiLCJleGVjdXRpb24iOiJDT05GSUdVUkVfVE9UUCIsInRhYl9pZCI6IkpKR0JCV0VDVGxzIiwibmJmIjoxNzAyMzcxNzM1LCJzZXNzaW9uX2NvZGUiOiJXNGY1dGxkV0lSdUJfeFBNSDNjYl9hMWtEaXZCN3I1MWNONUtmTjRxcUEwIiwic2Vzc2lvbl9pZGVudGlmaWVyIjoiSkpHQkJXRUNUbHMiLCJleHAiOjE3MDIzNzIwMzUsImlhdCI6MTcwMjM3MTczNSwiYXV0aF9zZXNzaW9uX2lkIjoiNGQ1ZWM1MzctMTYzMS00NWYxLWJlNmYtMmVkOWJkMGNkM2MwIiwianRpIjoiZTZmNWQzOWQtMDc0Yy00ODlmLWIzMGItMmQ2NzExZmM5YmU5In0.Q6Hx3WduIwKjiC7N8tm2nV7gk-sGt9ihv9Pg1xKd76A",
"authType": "otp",
"sessionIdentifier": "JJGBBWECTls"
}Success Response
Error Response
Response Schema
For a complete list of error codes and their meanings, refer to the Error Scenarios section.
TOTP Authentication API
The TOTP Authentication API is used when a user wants to authenticate their identity using the OTP method. After initiating a request for authentication, the server will respond with a session ID, bearer token, and a challenge. The user will respond to this challenge by generating and submitting the OTP from their chosen authenticator app. The API will validate this OTP against the secret stored during the provisioning phase.
API Description
Method : GET
URL : https://{environment-url}/realms/{partner-id}/protocol/api/init
Parameters
credential_id*
String
credential id generated during the process of provisioning
client_id*
String
A unique client id that is shared for each partner.
client_secret*
String
A unique key that is generated for each product configured for the partner.
type*
String
Type of the authentication
Eg:
otp
Success Response
The success response contains TOTP secret encoded key and a QR code which can be used to set up the authentication for receiving the TOTP on the supported authenticator apps.
Error Response
Response Schema
For a complete list of error codes and their meanings, refer to the Error Scenarios section.
Last updated
