Skip to content

Commit 76b666f

Browse files
authored
Merge pull request #227826 from spelluru/patch-156
Service Bus authentication: Review & update
2 parents dbc95b0 + 9175b95 commit 76b666f

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

articles/service-bus-messaging/service-bus-authentication-and-authorization.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
title: Azure Service Bus authentication and authorization | Microsoft Docs
33
description: Authenticate apps to Service Bus with Shared Access Signature (SAS) authentication.
44
ms.topic: article
5-
ms.date: 02/01/2022
5+
ms.date: 02/17/2023
66
---
77

88
# Service Bus authentication and authorization
9-
There are two ways to authenticate and authorize access to Azure Service Bus resources: Azure Active Directory (Azure AD) and Shared Access Signatures (SAS). This article gives you details on using these two types of security mechanisms.
9+
There are two ways to authenticate and authorize access to Azure Service Bus resources:
10+
11+
- Azure Active Directory (Azure AD)
12+
- Shared Access Signatures (SAS).
13+
14+
This article gives you details on using these two types of security mechanisms.
1015

1116
## Azure Active Directory
12-
Azure AD integration for Service Bus resources provides Azure role-based access control (RBAC) for fine-grained control over a client’s access to resources. You can use Azure RBAC to grant permissions to a 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 a Service Bus resource (queue, topic, and so on).
17+
Azure AD integration with Service Bus provides role-based access control (RBAC) to Service Bus resources. You can use Azure RBAC to grant permissions to a 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. This token can be used to authorize a request to access a Service Bus resource (queue, topic, and so on).
1318

1419
For more information about authenticating with Azure AD, see the following articles:
1520

@@ -20,23 +25,21 @@ For more information about authenticating with Azure AD, see the following artic
2025
> [Service Bus REST API](/rest/api/servicebus/) supports OAuth authentication with Azure AD.
2126
2227
> [!IMPORTANT]
23-
> Authorizing users or applications using OAuth 2.0 token returned by Azure AD provides superior security and ease of use over shared access signatures (SAS). With Azure AD, there is no need to store the tokens in your code and risk potential security vulnerabilities. We recommend that you use Azure AD with your Azure Service Bus applications when possible.
28+
> Authorizing users or applications using OAuth 2.0 token returned by Azure AD provides superior security and ease of use over shared access signatures (SAS). With Azure AD, there is no need to store tokens in your code and risk potential security vulnerabilities. We recommend that you use Azure AD with your Azure Service Bus applications when possible.
2429
>
2530
> You can disable local or SAS key authentication for a Service Bus namespace and allow only Azure AD authentication. For step-by-step instructions, see [Disable local authentication](disable-local-authentication.md).
2631
2732
## Shared access signature
2833
[SAS authentication](service-bus-sas.md) enables you to grant a user access to Service Bus resources, with specific rights. SAS authentication in Service Bus involves the configuration of a cryptographic key with associated rights on a Service Bus resource. Clients can then gain access to that resource by presenting a SAS token, which consists of the resource URI being accessed and an expiry signed with the configured key.
2934

30-
You can configure keys for SAS on a Service Bus namespace. The key applies to all messaging entities within that namespace. You can also configure keys on Service Bus queues and topics. SAS is also supported on [Azure Relay](../azure-relay/relay-authentication-and-authorization.md).
31-
32-
To use SAS, you can configure a shared access authorization rule on a namespace, queue, or topic. This rule consists of the following elements:
35+
You can configure keys for SAS on a Service Bus namespace. The key applies to all messaging entities within that namespace. You can also configure keys on Service Bus queues and topics. To use SAS, you can configure a shared access authorization rule on a namespace, queue, or topic. This rule consists of the following elements:
3336

34-
* *KeyName*: identifies the rule.
35-
* *PrimaryKey*: a cryptographic key used to sign/validate SAS tokens.
36-
* *SecondaryKey*: a cryptographic key used to sign/validate SAS tokens.
37-
* *Rights*: represents the collection of **Listen**, **Send**, or **Manage** rights granted.
37+
* **KeyName**: identifies the rule.
38+
* **PrimaryKey**: a cryptographic key used to sign/validate SAS tokens.
39+
* **SecondaryKey**: a cryptographic key used to sign/validate SAS tokens.
40+
* **Rights**: represents the collection of **Listen**, **Send**, or **Manage** rights granted.
3841

39-
Authorization rules configured at the namespace level can grant access to all entities in a namespace for clients with tokens signed using the corresponding key. You can configure up to 12 such authorization rules on a Service Bus namespace, queue, or topic. By default, a shared access authorization rule with all rights is configured for every namespace when it's first provisioned.
42+
Authorization rules configured at the namespace level can grant access to all entities in a namespace for clients with tokens signed using the corresponding key. You can configure up to 12 such authorization rules on a Service Bus namespace, queue, or topic. By default, a shared access authorization rule with all rights is configured for every namespace when it's first provisioned.
4043

4144
To access an entity, the client requires a SAS token generated using a specific shared access authorization rule. The SAS token is generated using the HMAC-SHA256 of a resource string that consists of the resource URI to which access is claimed, and an expiry with a cryptographic key associated with the authorization rule.
4245

0 commit comments

Comments
 (0)