Callbacks

This section describes the callbacks that should be implemented in order to receive feedback about the status of the SoundProof authentication attempt.

soundproof~checkSupportCallback : function

This callback gets the result of SoundProof support check. If the check passed, i.e., SoundProof is supported on this browser and system, then supported will be true and err will be undefined. If the check failed, then supported will be false and err will describe the why the check failed.

ParamTypeDescription
supportedbooleanIndicates whether the check passed or failed.
errstringA string describing the error if the check failed.

soundproof~onAudioInitSuccess : function

This callback gets called once the browser audio recording interface has been initialized successfully.

soundproof~onComplete : function

This callback gets called once SoundProof has been completed. The result will only be visible to the server, who can retrieve it via the /user/auth and /user/auth_status endpoints of the Auth API.

soundproof~onDeviceTimeout : function

This callback gets called if the user’s device cannot be reached within a reasonably short amount of time, so the operation timed out. This may be an indication that the user’s phone does not currently have network connectivity. Hence, a recommended approach is to fallback to mobile TOTP by asking the user to open the mobile app and transfer the currently displayed code. Note that this callback will immediately be followed by more callbacks, in particular onTimeout and onComplete which will signal that SoundProof timed out and completed (unsuccessfully).

ParamTypeDescription
displayTextstringA default message to show to the user. The web application can choose to display another message.

soundproof~onError : function

This callback gets called if SoundProof authentication fails due to an error.

ParamTypeDescription
errBadSampleRateError | BrowserMicError | GenericSoundProofError | MediaError | MobileAppMicPermissionError | MobileAppMicBusyError | NetworkErrorAn optional error object describing the error that occurred, if any. It may be undefined.
displayTextstringA default message to show to the user. The web application can choose to display another message.

soundproof~onNewDeviceMustApprove : function

This callback gets called if SoundProof failed because the user is logging in for the first time from this browser, and he must manually approve the login (see “new_device_must_approve” param in /user/auth endpoint of the Futurae Auth API). Your application can inform the user to reach for his/her device and accept or reject the login.

ParamTypeDescription
displayTextstringA default message to show to the user. The web application can choose to display another message.

soundproof~onRecordingStart : function

This callback gets called when SoundProof starts recording audio.

soundproof~onRecordingEnd : function

This callback gets called when SoundProof finishes recording audio.

soundproof~onRecordingTooSilent : function

This callback gets called if SoundProof detects that there is not enough audio energy in the environment. A message can be displayed to the user to encourage him to make some arbitrary noise in order to inject some audio energy in the environment.

ParamTypeDescription
displayTextstringA default message to show to the user. The web application can choose to display another message.

soundproof~onRetry : function

This callback gets called if the audio comparison fails for some reason and SoundProof automatically retries (one or maximum two times).

ParamTypeDescription
displayTextstringA default message to show to the user. The web application can choose to display another message.

soundproof~onSoundProofFailed : function

This callback gets called if SoundProof failed while performed together with the approve combo. The process will still continue until the user accepts/rejects the login or the approve factor times-out. Your application can inform the user to reach for his/her device and accept or reject the login. Note that onError will still get called in order provide more information about the error that caused SoundProof to fail. This callback just indicates that the current authentication attempt is not over yet, even if SoundProof failed, as the user can still manually approve the login.

ParamTypeDescription
displayTextstringA default message to show to the user. The web application can choose to display another message.

soundproof~onTimeout : function

This callback gets called if SoundProof times out before the protocol has been completed. Your application will have to start the SoundProof authentication once again, or retry with another factor.


Futurae Logo

© 2019 Futurae Technologies AG. All rights reserved.
Crafted in Zurich, CH

support@futurae.com
+41 (0) 44 500 88 26