This page is an extension of the regular Authentication API: Start a new authentication (POST). However, in this case, usage of voice for authentication requires special considerations, which involve additional fields.
Request parameters
Parameter | Description |
---|---|
payload | The payload returned from an authentication request which originated from a mobile application which is integrated with PingID SDK. |
locale |
The international locale for voice configuration.
|
voiceMessage |
The voice authentication message.
The voice message which is sent in order to authenticate a user. Refer to Offline devices (voice) pairing API for details and examples of message usage. |
voiceVendor |
Deprecated. |
Vendor specific supported voices. Currently supported Twilio voices:
Currently supported Syniverse voices:
|
|
User defined parameters, for the purpose of embedding application values into the voice message.
You can define any application parameters, except for ${otp} or parameters starting with ${pingid_} |
Authenticate using voice, without payload (POST)
This section focuses on the scenarios where the authenticating device is a voice device.
The authenticating device is an voice device in one of the following cases:
- The authentication request contains the device ID which is known to be a voice device.
- The authentication request does not contain the device ID, and it is possible that the authenticating device will be a voice device.
The following examples deal with scenarios in which an authentication request does not contain a mobile application payload.
Relative Path
/accounts/{accountId}/applications/{applicationId}/users/{username}/authentications
Additional fields in the authentication request body structure
{
"voiceMessage": "Your authentication code is: ${OTP}", \
"locale": "en_US", \
"voiceParameters": {}, \
"voice": "Alice"
}
Authentication using the additional voice fields
Voice authentication request body
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
"voiceMessage": "Your authentication code is: ${OTP}", \
"locale": "en_US", \
"voiceParameters": {}, \
"voice": "Alice" \
}' 'https://sdk.pingid.com/pingid/v1/accounts/a3407e72-71af-4831-a6a1-37e5e94fc07d/applications/dad9528a-f889-4b90-9300-b929d995a2b6/users/user1/authentications'
Voice authentication response
{
"self": {
"href": "https://sdk.pingid.com/pingid/v1/accounts/a3407e72-71af-4831-a6a1-37e5e94fc07d/applications/dad9528a-f889-4b90-9300-b929d995a2b6/users/or1/authentications/webs_c8c26de3-25bf-4fbe-8f64-03f96e9e64e0"
},
"user": {
"href": "https://sdk.pingid.com/pingid/v1/accounts/a3407e72-71af-4831-a6a1-37e5e94fc07d/users/or1"
},
"account": {
"href": "https://sdk.pingid.com/pingid/v1/accounts/a3407e72-71af-4831-a6a1-37e5e94fc07d"
},
"id": "webs_c8c26de3-25bf-4fbe-8f64-03f96e9e64e0",
"deviceId": "1b2a61e7-ff6f-407d-1b2a-61e7ff6f407d",
"status": "OTP",
"device": {
"deviceType": "Voice",
"id": "1b2a61e7-ff6f-407d-1b2a-61e7ff6f407d",
"deviceName": null,
"deviceNickname": "User1 Voice",
"deviceFingerprint": "12025556666",
"deviceRole": "primary",
"enrollmentTime": 1528202193730,
"applicationId": "dad9528a-f889-4b90-9300-b929d995a2b6",
"bypassExpiration": null,
"bypassed": false,
"phoneNumber": "37500638",
"emailAddress": null,
"countryCode": "972",
"pushEnabled": false,
"osVersion": null,
"applicationVersion": null,
"deviceStatus": "ACTIVE"
},
"requiredLevel": "PUSH",
"level": "NONE",
"payload": "",
"enableGetPayloadResponseMobileApi": false
}
Finalizing voice authentication
When the authenticating device is a voice device, the authentication must be finalized.
The PUT method using the otp
parameter with the OTP value returned by the user finalizes authentication, and the id of this authentication, which was initiated in the previous step (POST).
The session becomes invalid after successful authentication has completed. If there is an attempt to reuse the same OTP in the same user authentication session, it will be rejected.
Relative Path
/accounts/{accountId}/applications/{applicationId}/users/{username}/authentications/{authenticationId}/otp
Request body structure
Use the following request body structure to finalize authentication:
{
"otp": "<the OTP from the user>",
}
Voice authentication finalization request body example
curl -X PUT \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: PINGID-HMAC=<JWT>' \
-d '{ \
"otp": "363451" \
}' 'https:// sdk.pingid.com/pingid/v1/accounts/bb09a7a1-b359-418c-9c66-d8b91d83fda4/applications/3f02bbd2-1291-41ae-9663-3a2b75956d6a/users/user1/authentications/webs_4259429a-8fb2-438c-8897-c205f188f4a3/otp'
Voice authentication finalization response example
{
"id": "webs_4259429a-8fb2-438c-8897-c205f188f4a3",
"status": "APPROVED",
"deviceId": "6086deb9-def7-bfc2-6086-deb9def7bfc2",
"requiredLevel": "PUSH",
"level": "OTP",
"payload": ""
}
Voice authentication with SDK payload
Any authentication request which originates from a mobile application that is integrated with PingID SDK must always contain the SDK payload. If an application with SDK integration on an unpaired mobile device issues an authentication request to an active user who has at least one paired device, the user’s primary or selected device must approve authentication to the unpaired device.
When the approving device is an voice device, the message
parameter in the authentication request may also contain the accessing device’s name and device type.
Voice authentication structure example, when the request contains SDK payload
Authentication using the additional voice fields
Additional fields in the authentication request body structure
{
“payload”: “<payload from the mobile application>”, \
"voiceMessage": "Your authentication code is: ${OTP}", \
"locale": "en_US", \
"voiceParameters": {}, \
"voice": "Alice"
}
Voice authentication request body
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
"payload": "", \
"voiceMessage": "Your authentication code is: ${OTP}", \
"locale": "en_US", \
"voiceParameters": {}, \
"voice": "Alice" \
}' 'https://sdk.pingid.com/pingid/v1/accounts/a3407e72-71af-4831-a6a1-37e5e94fc07d/applications/dad9528a-f889-4b90-9300-b929d995a2b6/users/user1/authentications'