Skip to content

Commit 8a2aa9f

Browse files
committed
Implementations
1 parent 893bf34 commit 8a2aa9f

2 files changed

Lines changed: 197 additions & 1 deletion

File tree

articles/event-grid/authenticate-with-namespaces-using-webhook-authentication.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,38 @@ az eventgrid namespace update --resource-group <resource group name> --name <nam
4747

4848
For information on how to configure system and user-assigned identities by using the Azure portal, see [Enable managed identity for an Event Grid namespace](event-grid-namespace-managed-identity.md).
4949

50+
## Implementations
5051

52+
### Option 1: Webhook Via Azure Functions implementation (Microsoft Entra App)
53+
54+
Azure Functions can host the webhook logic using `Microsoft.Identity.Web` to validate token automatically. We need Microsoft Entra app registration for Webhook API for validating Event Grid caller tokens, which has an Application ID URI for token issuance. Client side (Event Grid) already has managed identity.
55+
56+
**Pros:**
57+
58+
- No infrastructure to manage
59+
- Built-in authentication helpers (`Microsoft.Identity.Web`)
60+
- Durable, scalable, cost-efficient
61+
62+
Function must do the following operations:
63+
64+
- Validate caller token from Event Grid Managed Identity
65+
- Validate client Json Web Token (JWT)
66+
- Return allow or deny JSON
67+
68+
### Option 2: External HTTPS endpoint implementation
69+
70+
This implementation can be any external HTTPS Endpoint (any cloud, any backend), using Microsoft Entra ID JWT validation with `Microsoft.IdentityModel` libraries.
71+
72+
Use any runtime: .NET / Node / Java / Python.
73+
74+
Key requirements:
75+
76+
- Must be HTTPS
77+
- Must validate caller JWT
78+
- Must validate device JWT
79+
- Must respond within timeout (~5 sec recommended)
80+
81+
:::image type="content" source="./media/authenticate-with-namespaces-using-webhook-authentication/custom-webhook-implementations.svg" alt-text="Diagram that shows custom webhook implementations." lightbox="./media/authenticate-with-namespaces-using-webhook-authentication/custom-webhook-implementations.svg":::
5182

5283

5384
## Grant the managed identity appropriate access to a function or webhook
@@ -165,7 +196,7 @@ The token is a Microsoft Entra token for the managed identity that was configure
165196
| `password` | Optional | Password from MQTT CONNECT packet in Base64 encoding. |
166197
| `authenticationMethod` | Optional | Authentication method from MQTT CONNECT packet (MQTT5 only). |
167198
| `authenticationData` | Optional | Authentication data from MQTT CONNECT packet in Base64 encoding (MQTT5 only). |
168-
| `clientCertificate` | Optional | Client certificate in PEM format. |
199+
| `clientCertificate` | Optional | Client certificate in Privacy-Enhanced Mail (PEM) format. |
169200
| `clientCertificateChain`| Optional | Other certificates provided by the client required to build the chain from the client certificate to the Certificate Authority certificate. |
170201
| `userProperties` | Optional | User properties from CONNECT packet (MQTT5 only). |
171202

0 commit comments

Comments
 (0)