Create Secret Key
post
/oaa/runtime/totp/key/v1/
Use this API to create a TOTP secret key for a user.
Request
There are no request parameters for this operation.
Supported Media Types
- application/xml
- application/json
Root Schema : schema
Type:
object
Details for creating a secret key for a user.
Show Source
-
deviceName: string
Name of the device. This should be recognizable by the user.
-
groupName(required): string
User's group name.
-
uniqueUserId: string
Immutable ID of the user in the external systems. If this is present, then it takes precedence over userId + groupId combination.
-
userName(required): string
User's username.
Root Schema : schema
Type:
object
Details for creating a secret key for a user.
Show Source
-
deviceName: string
Name of the device. This should be recognizable by the user.
-
groupName(required): string
User's group name.
-
uniqueUserId: string
Immutable ID of the user in the external systems. If this is present, then it takes precedence over userId + groupId combination.
-
userName(required): string
User's username.
Response
Supported Media Types
- application/xml
- application/json
- text/plain
201 Response
Secret key has been created.
Root Schema : SecretKey
Type:
object
A user's secret key.
Show Source
-
secret_key(required): string
Secret key of user.
400 Response
Bad Request
401 Response
Unauthorized
403 Response
Could not register secret key
422 Response
Requested user information not found
500 Response
Internal server error
503 Response
Service Unavailable
Examples
The following example shows a sample request and response for creating a Time-based One Time Password (TOTP) secret key for a user.
cURL Command to Create a TOTP in JSON Format
curl --location --request POST '<OAAService>/oaa/runtime/totp/key/v1/' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data '{ "groupName": "testfinanceapp4", "userName": "testuser4", "deviceName": "secretKeyApiTest" }'
Sample Response in JSON Format
{"secret_key": "4Z5CQ6ET3KB22YV2"}
cURL Command to Create a TOTP in XML Format
curl --location --request POST '<OAAService>/oaa/runtime/totp/key/v1/' \ --header 'Content-Type: application/xml' \ --header 'Accept: application/xml' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data '<?xml version="1.0" encoding="UTF-8" ?> <CreateSecretKeyRequest> <groupName>testfinanceapp4</groupName> <userName>testuser4</userName> <deviceName>secretKeyApiTest</deviceName> </CreateSecretKeyRequest>'
Sample Response in XML Format
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SecretKey> <secret_key>4Z5CQ6ET3KB22YV2</secret_key> </SecretKey>