Skip to content

Commit cd47418

Browse files
asaflevi-mskoen-mertenscatalinaperalta
authored
Add Entra ID OAuthe2 token support (#29032)
* Add AAD OAuthe2 token support * EntraIdToken * Update specification/ai/HealthInsights/HealthInsights.OpenAPI/service.tsp Co-authored-by: catalinaperalta <[email protected]> * remove suppression * update spec after merge --------- Co-authored-by: koen-mertens <[email protected]> Co-authored-by: catalinaperalta <[email protected]>
1 parent 92a02c9 commit cd47418

File tree

2 files changed

+21
-1
lines changed
  • specification/ai

2 files changed

+21
-1
lines changed

specification/ai/HealthInsights/HealthInsights.OpenAPI/service.tsp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ using TypeSpec.Versioning;
1616
endpoint: url,
1717
}
1818
)
19-
@useAuth(AzureKey)
19+
@useAuth(AzureKey | EntraIdToken)
2020
namespace AzureHealthInsights;
2121

2222
@doc("The secret key for your Azure Cognitive Services subscription.")
2323
model AzureKey
2424
is ApiKeyAuth<ApiKeyLocation.header, "Ocp-Apim-Subscription-Key">;
2525

26+
@doc("The Microsoft Entra Id Flow")
27+
model EntraIdToken
28+
is Azure.Core.AadOauth2Auth<["https://cognitiveservices.azure.com/.default"]>;
29+
30+
#suppress "@azure-tools/typespec-azure-core/documentation-required" "https://github.com/Azure/typespec-azure/issues/3107"
2631
enum ApiVersion {
2732
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
2833
v2024_04_01: "2024-04-01",

specification/ai/data-plane/HealthInsights/stable/2024-04-01/openapi.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
"security": [
3838
{
3939
"AzureKey": []
40+
},
41+
{
42+
"EntraIdToken": [
43+
"https://cognitiveservices.azure.com/.default"
44+
]
4045
}
4146
],
4247
"securityDefinitions": {
@@ -45,6 +50,16 @@
4550
"description": "The secret key for your Azure Cognitive Services subscription.",
4651
"name": "Ocp-Apim-Subscription-Key",
4752
"in": "header"
53+
},
54+
"EntraIdToken": {
55+
"type": "oauth2",
56+
"description": "The Microsoft Entra Id Flow",
57+
"flow": "accessCode",
58+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
59+
"scopes": {
60+
"https://cognitiveservices.azure.com/.default": ""
61+
},
62+
"tokenUrl": "https://login.microsoftonline.com/common/oauth2/token"
4863
}
4964
},
5065
"tags": [

0 commit comments

Comments
 (0)