Skip to content

Commit

Permalink
Support AAD Auth in EventGrid data plane client (#25935)
Browse files Browse the repository at this point in the history
* Support AAD Auth in EventGridClient

* Updating the scope to include .default

* reverting changes to package-lock.json

* Ran the npx tsv command
  • Loading branch information
batrived authored and jnlycklama committed Nov 8, 2023
1 parent 2942973 commit 72093ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion specification/eventgrid/Azure.Messaging.EventGrid/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@ import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";

@useAuth(ApiKeyAuth<ApiKeyLocation.header, "SharedAccessKey">)
@useAuth(
ApiKeyAuth<ApiKeyLocation.header, "SharedAccessKey"> | OAuth2Auth<[
{
type: OAuth2FlowType.implicit,
authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize",
scopes: ["https://eventgrid.azure.net/.default"],
}
]>
)
@service({
title: "Azure.Messaging.EventGridClient",
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,26 @@
"security": [
{
"ApiKeyAuth": []
},
{
"OAuth2Auth": [
"https://eventgrid.azure.net/.default"
]
}
],
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "SharedAccessKey",
"in": "header"
},
"OAuth2Auth": {
"type": "oauth2",
"flow": "implicit",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"scopes": {
"https://eventgrid.azure.net/.default": ""
}
}
},
"tags": [],
Expand Down

0 comments on commit 72093ad

Please sign in to comment.