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
Copy file name to clipboardExpand all lines: articles/event-grid/authenticate-with-namespaces-using-json-web-tokens.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,11 @@ az eventgrid namespace update --resource-group <resource group name> --name <nam
43
43
44
44
For information configuring system and user-assigned identities using the Azure portal, see [Enable managed identity for an Event Grid namespace](event-grid-namespace-managed-identity.md).
45
45
46
-
## Create an Azure Key Vault account and upload your server certificate
46
+
47
+
## Configure OAuth 2.0 JWT authentication settings on your Event Grid namespace -Key Vault
48
+
First, create an Azure Key Vault account, upload your server certificate, and assign the namespace's managed identity an appropriate role on the key vault. Then, you configure custom authentication settings on your Event Grid namespace using Azure portal and Azure CLI. You need to create the namespace first then update it using the following steps.
49
+
50
+
### Create an Azure Key Vault account and upload your server certificate
47
51
48
52
1. Use the following command to create an Azure Key Vault account:
49
53
@@ -59,7 +63,7 @@ For information configuring system and user-assigned identities using the Azure
59
63
> Your certificate must include the domain name in the Subject Alternative name for DNS. For more information, see [Tutorial: Import a certificate in Azure Key Vault](/azure/key-vault/certificates/tutorial-import-certificate).
60
64
61
65
62
-
## Add role assignment in Azure Key Vault for the namespace’s managed identity
66
+
### Add role assignment in Azure Key Vault for the namespace’s managed identity
63
67
You need to provide access to the namespace to access your Azure Key Vault account using the following steps:
64
68
65
69
1. Get Event Grid namespace system managed identity principal ID using the following command
@@ -80,17 +84,15 @@ You need to provide access to the namespace to access your Azure Key Vault accou
80
84
81
85
For more information about Key Vault access and the portal experience, see [Provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control](/azure/key-vault/general/rbac-guide).
82
86
83
-
## Configure OAuth 2.0 JWT authentication settings on your Event Grid namespace -Key Vault
84
-
In this step, you configure custom authentication settings on your Event Grid namespace using Azure portal and Azure CLI. You need to create the namespace first then update it using the following steps.
85
87
86
-
### Use Azure portal
88
+
### Use Azure portal to configure authentication
87
89
88
90
1. Navigate to your Event Grid namespace in the [Azure portal](https://portal.azure.com).
89
91
1. On the **Event Grid Namespace** page, select **Configuration** on the left menu.
90
92
1. In the **Custom JWT authentication** section, specify values for the following properties:
91
93
1. Select **Enable custom JWT authentication**.
92
94
1. **Token Issuer**: Enter the value of the issuer claims of the JWTs, presented by the MQTT clients.
93
-
1. Select **Add issuer certificate**
95
+
1. For **Issuer certificate**, select **From Azure Key Vault**.
94
96
95
97
:::image type="content" source="./media/authenticate-with-namespaces-using-json-web-tokens/configuration-custom-authentication.png" alt-text="Screenshot that shows the Custom JWT authentication section of the Configuration page for an Event Grid namespace." lightbox="./media/authenticate-with-namespaces-using-json-web-tokens/configuration-custom-authentication.png":::
96
98
1. In the new page, specify values for the following properties.
Copy file name to clipboardExpand all lines: articles/event-grid/mqtt-client-custom-jwt.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,26 @@ You can authenticate MQTT clients with OAuth 2.0 JWT to connect to the Event Gri
24
24
## Authentication using OAuth 2.0 JWT
25
25
You can use the MQTT v5 CONNECT packet to provide the OAuth 2.0 JWT to authenticate your client and the MQTT v5 AUTH packet to refresh the token.
26
26
27
+
> [!IMPORTANT]
28
+
> If you don't set the CONNECT packet's authentication method to CUSTOM-JWT, you receive an 'invalid issuer' error—even if all other configurations are correct.
29
+
30
+
In the CONNECT packet, you can provide the required values in the following fields:
31
+
32
+
|Field | Value |
33
+
|---------|---------|
34
+
|Authentication Method | CUSTOM-JWT |
35
+
|Authentication Data | JWT |
36
+
37
+
In the AUTH packet, you can provide the required values in the following fields:
38
+
39
+
|Field | Value |
40
+
|---------|---------|
41
+
| Authentication Method | CUSTOM-JWT |
42
+
| Authentication Data | JWT |
43
+
| Authentication Reason Code | 25 |
44
+
45
+
Authenticate Reason Code with value 25 signifies reauthentication.
46
+
27
47
> [!NOTE]
28
48
> Audience: `aud` claim must be set to `https://[namespace].ts.eventgrid.azure.net/`.
0 commit comments