The async APIs for transcribe and recognize provide for ability to authenticate the callback requests. In this way your callback HTTP endpoint listening on a publicly available URL will be secure from unauthorized requests.
Configuring authConf in the Web Console
Before using authConf you need to configure it in the Voicegain Web Console. This way the details of the authentication credentials do not need to be included in each API request - only the name of the authConf configuration needs to be passed.
The form to configure authConf can be found in Settings->API Security (this setting is not available when you are in the Transcribe Mode so you first have to switch to one of the other modes e.g. STT API.)
4 types of authentication configuration are supported now:
- Basic - basic HTTP auth configuration - you have to provide a Base64-encoded username and password, separated by a colon, just as if you were putting it into the HTTP request header (w/o the word Basic)
- Bearer - for example for using JWT tokens
- AWS- used to e.g. access S3 storage via AWS SDK
- in this case the credential parameter will be AccessKeyId followed by : followed by SecretAccessKey
- Twilio Encrypted Recordings
- the credential value will be the PKCS #8 private key in PEM format,
Using in an API request
Once you have entered and saved the Auth Configuration in the Web Console using it is trivial. You simply include the name of the auth config in the API request body next to the callback URL, e.g.:
...
sessions : [{
"asyncMode": "REAL-TIME", "callback" : { "uri" : "https://my.domain.com/my-callback/voice",
"authConfig" : "my-config",
"format" : "json"
},
"content" : {
"full" : ["words"]
}}]
...
Comments
0 comments
Please sign in to leave a comment.