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-hubs/authenticate-shared-access-signature.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,13 @@
2
2
title: Authenticate access to Azure Event Hubs with shared access signatures
3
3
description: This article shows you how to authenticate access to Event Hubs resources using shared access signatures.
4
4
ms.topic: conceptual
5
-
ms.date: 09/16/2022
5
+
ms.date: 03/13/2023
6
6
ms.devlang: csharp, java, javascript, php
7
7
ms.custom: devx-track-js, devx-track-csharp
8
8
---
9
+
9
10
# Authenticate access to Event Hubs resources using shared access signatures (SAS)
10
-
Shared access signature (SAS) gives you granular control over the type of access you grant to the clients who has the shared access signature. Here are some of the controls you can set in a SAS:
11
+
Shared access signature (SAS) gives you granular control over the type of access you grant to the clients. Here are some of the controls you can set in a SAS:
11
12
12
13
- The interval over which the SAS is valid, which includes the start time and expiry time.
13
14
- The permissions granted by the SAS. For example, a SAS for an Event Hubs namespace might grant the listen permission, but not the send permission.
@@ -24,15 +25,15 @@ This article covers authenticating the access to Event Hubs resources using SAS.
24
25
25
26
26
27
## Configuring for SAS authentication
27
-
You can configure a shared access authorization rule on an Event Hubs namespace, or an entity (event hub instance or Kafka Topic in an event hub). Configuring a shared access authorization rule on a consumer group is currently not supported, but you can use rules configured on a namespace or entity to secure access to consumer group.
28
+
You can configure a SAS rule on an Event Hubs namespace, or an entity (event hub instance or Kafka Topic in an event hub). Configuring a SAS rule on a consumer group is currently not supported, but you can use rules configured on a namespace or entity to secure access to consumer group.
28
29
29
30
The following image shows how the authorization rules apply on sample entities.
In this example, the sample Event Hubs namespace (ExampleNamespace) has two entities: eh1 and topic1. The authorization rules are defined both at the entity level and also at the namespace level.
34
+
In this example, the sample Event Hubs namespace (ExampleNamespace) has two entities: eh1 and Kafka topic1. The authorization rules are defined both at the entity level and also at the namespace level.
34
35
35
-
The manageRuleNS, sendRuleNS, and listenRuleNS authorization rules apply to both event hub instance eh1 and topic t1. The listenRule-eh and sendRule-eh authorization rules apply only to event hub instance eh1 and sendRuleT authorization rule applies only to topic topic1.
36
+
The manageRuleNS, sendRuleNS, and listenRuleNS authorization rules apply to both eh1 and t1. The listenRule-eh and sendRule-eh authorization rules apply only to eh1 and sendRuleT authorization rule applies only to topic1.
36
37
37
38
When you use sendRuleNS authorization rule, client applications can send to both eh1 and topic1. When sendRuleT authorization rule is used, it enforces granular access to topic1 only and hence client applications using this rule for access now can't send to eh1, but only to topic1.
38
39
@@ -44,9 +45,7 @@ Any client that has access to name of an authorization rule name and one of its
44
45
-`sr` – URI of the resource being accessed.
45
46
-`sig` – Signature.
46
47
47
-
The signature-string is the SHA-256 hash computed over the resource URI (scope as described in the previous section) and the string representation of the token expiry instant, separated by CRLF.
48
-
49
-
The hash computation looks similar to the following pseudo code and returns a 256-bit/32-byte hash value.
48
+
The signature-string is the SHA-256 hash computed over the resource URI (scope as described in the previous section) and the string representation of the token expiry instant, separated by CRLF. The hash computation looks similar to the following pseudo code and returns a 256-bit/32-byte hash value.
@@ -58,7 +57,7 @@ The resource URI is the full URI of the Service Bus resource to which access is
58
57
59
58
The URI must be percent-encoded.
60
59
61
-
The shared access authorization rule used for signing must be configured on the entity specified by this URI, or by one of its hierarchical parents. For example, `http://contoso.servicebus.windows.net/eh1` or `http://contoso.servicebus.windows.net` in the previous example.
60
+
The SAS rule used for signing must be configured on the entity specified by this URI, or by one of its hierarchical parents. For example, `http://contoso.servicebus.windows.net/eh1` or `http://contoso.servicebus.windows.net` in the previous example.
62
61
63
62
A SAS token is valid for all resources prefixed with the `<resourceURI>` used in the signature-string.
64
63
@@ -274,11 +273,11 @@ For certain organizational security requirements, you may have to disable local/
274
273
### Disabling Local/SAS Key authentication via the portal
275
274
You can disable local/SAS key authentication for a given Event Hubs namespace using the Azure portal.
276
275
277
-
As shown in the following image, in the namespace overview section, click on the *Local Authentication*.
276
+
As shown in the following image, in the namespace overview section, select **Local Authentication**.
278
277
279
278

280
279
281
-
And then select *Disabled* option and click *Ok* as shown below.
280
+
And then select **Disabled** option and select **Ok** as shown below.
282
281

283
282
284
283
### Disabling Local/SAS Key authentication using a template
Copy file name to clipboardExpand all lines: articles/event-hubs/authorize-access-event-hubs.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
title: Authorize access to Azure Event Hubs
3
3
description: This article provides information about different options for authorizing access to Azure Event Hubs resources.
4
4
ms.topic: conceptual
5
-
ms.date: 09/20/2021
5
+
ms.date: 03/13/2023
6
6
ms.author: spelluru
7
7
---
8
8
9
9
# Authorize access to Azure Event Hubs
10
-
Every time you publish or consume events/data from an event hub, your client is trying to access Event Hubs resources. Every request to a secure resource must be authorized so that the service can ensure that the client has the required permissions to publish/consume the data.
10
+
Every time you publish or consume events from an event hub, your client is trying to access Event Hubs resources. Every request to a secure resource must be authorized so that the service can ensure that the client has the required permissions to publish or consume the data.
11
11
12
12
Azure Event Hubs offers the following options for authorizing access to secure resources:
13
13
@@ -18,19 +18,19 @@ Azure Event Hubs offers the following options for authorizing access to secure r
18
18
> This article applies to both Event Hubs and [Apache Kafka](azure-event-hubs-kafka-overview.md) scenarios.
19
19
20
20
## Azure Active Directory
21
-
Azure Active Directory (Azure AD) integration for Event Hubs resources provides Azure role-based access control (Azure RBAC) for fine-grained control over a client's access to resources. You can use Azure RBAC to grant permissions to security principal, which may be a user, a group, or an application service principal. The security principal is authenticated by Azure AD to return an OAuth 2.0 token. The token can be used to authorize a request to access an Event Hubs resource.
21
+
Azure Active Directory (Azure AD) integration with Event Hubs resources provides Azure role-based access control (Azure RBAC) for fine-grained control over a client's access to resources. You can use Azure RBAC to grant permissions to security principal, which may be a user, a group, or an application service principal. Azure AD authenticates the security principal and returns an OAuth 2.0 token. The token can be used to authorize a request to access an Event Hubs resource.
22
22
23
23
For more information about authenticating with Azure AD, see the following articles:
24
24
25
-
-[Authenticate requests to Azure Event Hubs using Azure Active Directory](authenticate-application.md)
26
-
-[Authorize access to Event Hubs resources using Azure Active Directory](authorize-access-azure-active-directory.md).
25
+
-[Authenticate requests to Azure Event Hubs using Azure AD](authenticate-application.md)
26
+
-[Authorize access to Event Hubs resources using Azure AD](authorize-access-azure-active-directory.md).
27
27
28
28
## Shared access signatures
29
29
Shared access signatures (SAS) for Event Hubs resources provide limited delegated access to Event Hubs resources. Adding constraints on time interval for which the signature is valid or on permissions it grants provides flexibility in managing resources. For more information, see [Authenticate using shared access signatures (SAS)](authenticate-shared-access-signature.md).
30
30
31
31
Authorizing users or applications using an OAuth 2.0 token returned by Azure AD provides superior security and ease of use over shared access signatures (SAS). With Azure AD, there's no need to store the access tokens with your code and risk potential security vulnerabilities. While you can continue to use shared access signatures (SAS) to grant fine-grained access to Event Hubs resources, Azure AD offers similar capabilities without the need to manage SAS tokens or worry about revoking a compromised SAS.
32
32
33
-
By default, all Event Hubs resources are secured, and are available only to the account owner. Although you can use any of the authorization strategies outlined above to grant clients access to Event Hub resources. Microsoft recommends using Azure AD when possible for maximum security and ease of use.
33
+
By default, all Event Hubs resources are secured, and are available only to the account owner. Although you can use any of the authorization strategies outlined above to grant clients access to Event Hubs resources. Microsoft recommends using Azure AD when possible for maximum security and ease of use.
34
34
35
35
For more information about authorization using SAS, see [Authorizing access to Event Hubs resources using Shared Access Signatures](authorize-access-shared-access-signature.md).
0 commit comments