Version (please complete the following information):
OS: MacOS
Browser: Chrome
Web Clipper version: 0.10.0
Obsidian version: 1.7.7
Describe the bug
When I go to the Interpreter and try to insert a new model, I provide all the details of my model hosted on Azure OpenAI. However, when running the extension, the following error occurs even though all the information is correct (as verified via request in Postman).
{
"Azure error":
{
"statusCode": 401,
"message": "Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired."
}
}
Expected behavior
The request is executed successfully.
URLs where the bug occurs
All URL.
To reproduce
Steps to reproduce the behavior:
Go to Interpreter in the extension options.
Click on Add Model.
Add the model information hosted on Azure OpenAI.
Execute on any page.
Error:
{
"Azure error":
{
"statusCode": 401,
"message": "Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired."
}
}
Your template file
N/A
Additional Information
As can be seen in the Azure OpenAI API documentation, there are two types of authentication, as follows:
API Key authentication: For this type of authentication, all API requests must include the API Key in the api-key HTTP header.
Microsoft Entra ID authentication: You can authenticate an API call using a Microsoft Entra token. Authentication tokens are included in a request as the Authorization header. The token provided must be preceded by Bearer, for example, Bearer YOUR_AUTH_TOKEN.
For the case 1 (mostly common?), the extension fails, causing the previously mentioned error due to a request problem that only uses Authorization: Bearer ... and don't validade if needs use api-key instead of Authorization
A proposed solution (implemented locally and validated functionality) would be to identify through a regex to validate the URL in the pattern openai.azure.com.
If you are interested, I can open a PR for this solution.
Version (please complete the following information):
Describe the bug
When I go to the Interpreter and try to insert a new model, I provide all the details of my model hosted on Azure OpenAI. However, when running the extension, the following error occurs even though all the information is correct (as verified via request in Postman).
Expected behavior
The request is executed successfully.
URLs where the bug occurs
All URL.
To reproduce
Steps to reproduce the behavior:
Your template file N/A
Additional Information As can be seen in the Azure OpenAI API documentation, there are two types of authentication, as follows:
API Key authentication: For this type of authentication, all API requests must include the API Key in the
api-key
HTTP header.Microsoft Entra ID authentication: You can authenticate an API call using a Microsoft Entra token. Authentication tokens are included in a request as the
Authorization
header. The token provided must be preceded byBearer
, for example,Bearer YOUR_AUTH_TOKEN
.For the case 1 (mostly common?), the extension fails, causing the previously mentioned error due to a request problem that only uses
Authorization: Bearer ...
and don't validade if needs useapi-key
instead ofAuthorization
A proposed solution (implemented locally and validated functionality) would be to identify through a regex to validate the URL in the pattern
openai.azure.com
.If you are interested, I can open a PR for this solution.