Azure-Samples / AzureSpeechReactSample

This sample shows how to integrate the Azure Speech service into a sample React application. This sample shows design pattern examples for authentication token exchange and management, as well as capturing audio from a microphone or file for speech-to-text conversions.
MIT License
126 stars 77 forks source link

401 error while getting token #10

Closed TishaInnovya closed 2 weeks ago

TishaInnovya commented 2 weeks ago

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

{"error":{"code":"401","message":"Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource."}}

Expected/desired behavior

It should provide the token

OS and Version?

Windows 10

Versions

Node - v18.0.0

Mention any other details that might be useful

I have double checked the keys and the region, it's the same at present in the azure portal. I have also tried the curl to get the token and still getting the same error. I am not sure if I am missing something or doing anything wrong.

Curl Request - curl -v -X POST "https://eastus.api.cognitive.microsoft.com/sts/v1.0/issueToken" -H "Ocp-Apim-Subscription-Key: " -H "Content-type: application/x-www-form-urlencoded" -H "Content-Length: 0"