azurebing-speech

How to save SubscriptionKey on javascript


I make speech recognition App using Bing speech API with javascript library. But I need to contain SubscriptionKey to Html/JS code using Library.

I think another person can see my key and use it. How to save my key? Can regenerate key dynamically on each user access? or Can set expire limitation to key?


Solution

  • You are recommended to make calls from the server side. You can initiate a call from your client to server, where your client is whitelisted and then make a call to the API. Alternately, you can use Azure Key Vault to generate secret and use that and change that often. Further, you are recommended to change subscription keys and/or Azure Key Vault secret often to limit exposure.

    A similar question but for Bing Maps is posted here: http://www.garzilla.net/vemaps/Protecting-Your-Map-Key.aspx.