You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you're using the `Authorization: Bearer` header, you're required to make a request to the `issueToken` endpoint. In this request, you exchange your resource key for an access token that's valid for 10 minutes.
22
+
When you're using the `Authorization: Bearer` header, you need to make a request to the `issueToken` endpoint. In this request, you exchange your resource key for an access token that's valid for 10 minutes.
23
+
24
+
Another option is to use Microsoft Entra authentication that also uses the `Authorization: Bearer` header, but with a token issued via Microsoft Entra ID. See [Use Microsoft Entra authentication](#use-microsoft-entra-authentication).
23
25
24
26
### How to get an access token
25
27
@@ -154,3 +156,42 @@ Connection: Keep-Alive
154
156
155
157
// Message body here...
156
158
```
159
+
160
+
### Use Microsoft Entra authentication
161
+
162
+
To use Microsoft Entra authentication with the Speech to text REST API for short audio, you need to create an access token.
163
+
The steps to obtain the access token consisting of Resource ID and Microsoft Entra access token are the same as when using the Speech SDK.
164
+
Follow the steps here [Use Microsoft Entra authentication](../how-to-configure-azure-ad-auth.md)
165
+
166
+
> [!div class="checklist"]
167
+
>
168
+
> - Create a Speech resource
169
+
> - Configure the Speech resource for Microsoft Entra authentication
170
+
> - Get a Microsoft Entra access token
171
+
> - Get the Speech resource ID
172
+
173
+
After the resource ID and the Microsoft Entra access token were obtained, the actual access token can be constructed following this format:
You need to include the "aad#" prefix and the "#" (hash) separator between resource ID and the access token.
178
+
179
+
Here's a sample HTTP request to the Speech to text REST API for short audio:
180
+
181
+
```http
182
+
POST /cognitiveservices/v1 HTTP/1.1
183
+
Authorization: Bearer YOUR_ACCESS_TOKEN
184
+
Host: westus.stt.speech.microsoft.com
185
+
Content-type: application/ssml+xml
186
+
Content-Length: 199
187
+
Connection: Keep-Alive
188
+
189
+
// Message body here...
190
+
```
191
+
192
+
To learn more about Microsoft Entra access tokens, including token lifetime, visit [Access tokens in the Microsoft identity platform](/azure/active-directory/develop/access-tokens).
0 commit comments