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-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,8 @@ To use OAuth 2.0 JWT authentication for namespaces, follow these steps:
28
28
1. Enable managed identity on your Event Grid namespace.
29
29
1. Configure OAuth 2.0 authentication settings on your Event Grid namespace by following these steps:
30
30
1. Create an Azure Key Vault account that hosts the CA certificate that includes your public keys and add role assignment in Key Vault for the namespace’s managed identity.
31
-
1. Upload the PEM file of your public key certificates to namespace.
31
+
1. Or upload the PEM file of your public key certificates to namespace.
32
+
32
33
1. Your clients can connect to the Event Grid namespace using the tokens provided by your identity provider.
33
34
34
35
## Create a namespace and configure its subresources
@@ -45,7 +46,7 @@ For information configuring system and user-assigned identities using the Azure
45
46
46
47
47
48
## 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
+
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 either Azure portal or Azure CLI. You need to create the namespace first then update it using the following steps.
49
50
50
51
### Create an Azure Key Vault account and upload your server certificate
51
52
@@ -132,8 +133,8 @@ az resource update \
132
133
133
134
```
134
135
### JSON Web Token format
135
-
JSON Web Tokens are divided into the JWT Headerand JWT payload sections.
136
-
136
+
JSON Web Tokens needs to have JWT Header, JWT payload and JWT signature sections.
137
+
137
138
### JWT Header
138
139
139
140
The header must contain at least `typ` and `alg` fields. `typ` must always be `JWS` and `alg` must always be `RS256`. The token header must be as follows:
@@ -154,7 +155,7 @@ Event Grid requires the following claims: `iss`, `sub`, `aud`, `exp`,
154
155
| --- | ----------- |
155
156
|`iss`| Issuer. Value in JWT must match issuer in the Event Grid namespace configuration for custom JWT authentication. |
156
157
|`sub`| Subject. Value is used as authentication identity name. |
157
-
|`aud`| Audience. Value can be a string or an array of strings. Value must contain standard Event Grid namespace hostname and/or custom domain for that Event Grid namespace (if configured). Audience can contain other strings, but we require at least one of these strings to be a standard Event Grid namespace hostname or custom domain for this namespace. |
158
+
|`aud`| Audience. Value is an array of strings. Value must contain standard Event Grid namespace hostname and/or custom domain for that Event Grid namespace (if configured). Audience can contain other strings, but we require at least one of these strings to be a standard Event Grid namespace hostname or custom domain for this namespace. |
158
159
|`exp`| Expiration. Unix time when JWT expires. |
159
160
|`nbf`| Not before. Unit time when JWT becomes valid. |
160
161
@@ -227,13 +228,13 @@ az eventgrid namespace update \
227
228
```
228
229
229
230
- Replace `<resource-group-name>`, `<namespace-name>`, `<location>`, `<key-vault-name>`, `<certificate-name>`, and `<certificate-in-PEM-format>` with your actual values.
230
-
- The encodedCertificate value must include the full certificate in PEM format, including headers ( `"-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE----`).
231
+
- The encodedCertificate value must include the full certificate and public key in PEM format, including headers ( `"-----BEGIN CERTIFICATE-----", "-----END CERTIFICATE----, ``-----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY-----`).
231
232
- Ensure the public key certificate provided is valid and trusted by your identity provider.
232
233
- Regularly update the encodedIssuerCertificates if certificates are rotated or expired.
233
234
234
235
### JSON Web Token format
235
236
236
-
JWT payload
237
+
JSON Web Tokens needs to have JWT Header, JWT payload and JWT signature sections.
237
238
238
239
Event Grid requires the following claims: `iss`, `sub`, `aud`, `exp`, `nbf`.
0 commit comments