TOTP API
Base URL: https://api.asgardeo.io/t/<ORGANIZATION_NAME>/api/users/v1
The WSO2 Identity Platform - TOTP API Definition (version v1).
Download the OpenAPI definition (YAML)
Security schemes
OAuth2: oauth2
You can use the following OAuth grant type to securely access the respective API endpoints.
Authorization Code OAuth Flow
Authorization URL: 'https://api.asgardeo.io/t/{org-name}/oauth2/authorize'
This flow type is used for the me endpoint of TOTP APIs. You can use the following scope for this endpoints.
internal_login: Grant permission for an authenticated user for self management.
me
Operations for the authenticated user.
Retrieve the QR Code URL
GET /me/totp
This API is used to retrieve the QR code URL of the authenticated user.
Scope required:internal_login
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | TOTPResponse |
401 | Unauthorized | |
403 | Resource Forbidden | |
500 | Server Error | Error |
Generate, refresh and validate the QR
POST /me/totp
This API is used to perform following actions.
<li><b>INIT</b>- Generate the TOTP QR code URL for the authenticated user.</li> <li><b>REFRESH</b> - Refresh the TOTP secret key of the authenticated user.</li> <li><b>VALIDATE</b> - Validate the user entered verification code.</li>Scope required: internal_login
Responses
| Code | Description | Schema |
|---|---|---|
200 | TOTP secret successfully refreshed | |
201 | Created | TOTPResponse |
400 | Bad Request | Error |
401 | Unauthorized | |
403 | Resource Forbidden | |
409 | Conflict | Error |
500 | Server Error | Error |
Retrieve the TOTP secret
GET /me/totp/secret
This API is used to retrieve the TOTP secret of the authenticated user.
Scope required:internal_login
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | TOTPSecretResponse |
401 | Unauthorized | |
403 | Resource Forbidden | |
500 | Server Error | Error |
Schemas
Error
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | |
message | string | Yes | |
description | string | ||
traceId | string |
UserRequest
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Allowed values: |
verificationCode | integer |
TOTPResponse
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
qrCodeUrl | string | QR Code URL for the authenticated user | |
isValid | boolean | Secret key of the authenticated user |
TOTPSecretResponse
Type: object
1 property
| Name | Type | Required | Description |
|---|---|---|---|
secret | string | Refreshed TOTP secret key of the authenticated user |
Was this page helpful?