Skip to content

Commit a718561

Browse files
authored
Merge pull request #232935 from terencefan/signalr/disable-local-auth
Add DisableLocalAuth docs for SignalR/Web PubSub
2 parents ff82fca + 5cc48eb commit a718561

37 files changed

+283
-38
lines changed

articles/azure-signalr/TOC.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@
123123
href: howto-shared-private-endpoints-key-vault.md
124124
- name: Use managed identity
125125
href: howto-use-managed-identity.md
126-
- name: Authorize from Azure Applications
126+
- name: Authorize from Azure application
127127
href: signalr-howto-authorize-application.md
128-
- name: Authorize from Managed Identity
128+
- name: Authorize from managed identity
129129
href: signalr-howto-authorize-managed-identity.md
130+
- name: Disable local authentication.
131+
href: howto-disable-local-auth.md
130132
- name: Custom domain
131133
href: howto-custom-domain.md
132134
- name: Integrate
@@ -210,4 +212,4 @@
210212
- name: Twitter
211213
href: https://twitter.com/SignalR
212214
- name: ASP.NET forums
213-
href: https://social.msdn.microsoft.com/Forums/en-US/home?forum=aspsignalr
215+
href: https://social.msdn.microsoft.com/Forums/en-US/home?forum=aspsignalr
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: Disable local (access key) authentication with Azure SignalR Service
3+
description: This article provides information about how to disable access key authentication and use only Azure AD authentication with Azure SignalR Service.
4+
author: terencefan
5+
6+
ms.author: tefa
7+
ms.date: 03/31/2023
8+
ms.service: signalr
9+
ms.topic: conceptual
10+
---
11+
12+
# Disable local (access key) authentication with Azure SignalR Service
13+
14+
There are two ways to authenticate to Azure SignalR Service resources: Azure Active Directory (Azure AD) and Access Key. Azure AD provides superior security and ease of use over access key. With Azure AD, there’s no need to store the tokens in your code and risk potential security vulnerabilities. We recommend that you use Azure AD with your Azure SignalR Service resources when possible.
15+
16+
> [!IMPORTANT]
17+
> Disabling local authentication can have following influences.
18+
> - The current set of access keys will be permanently deleted.
19+
> - Tokens signed with current set of access keys will become unavailable.
20+
21+
## Use Azure portal
22+
23+
In this section, you will learn how to use the Azure portal to disable local authentication.
24+
25+
1. Navigate to your SignalR Service resource in the [Azure portal](https://portal.azure.com).
26+
27+
2. in the **Settings** section of the menu sidebar, select **Keys** tab.
28+
29+
3. Select **Disabled** for local authentication.
30+
31+
4. Click **Save** button.
32+
33+
![Screenshot of disabling local auth.](./media/howto-disable-local-auth/disable-local-auth.png)
34+
35+
## Use Azure Resource Manager template
36+
37+
You can disable local authentication by setting `disableLocalAuth` property to true as shown in the following Azure Resource Manager template.
38+
39+
```json
40+
{
41+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
42+
"contentVersion": "1.0.0.0",
43+
"parameters": {
44+
"resource_name": {
45+
"defaultValue": "test-for-disable-aad",
46+
"type": "String"
47+
}
48+
},
49+
"variables": {},
50+
"resources": [
51+
{
52+
"type": "Microsoft.SignalRService/SignalR",
53+
"apiVersion": "2022-08-01-preview",
54+
"name": "[parameters('resource_name')]",
55+
"location": "eastus",
56+
"sku": {
57+
"name": "Premium_P1",
58+
"tier": "Premium",
59+
"size": "P1",
60+
"capacity": 1
61+
},
62+
"kind": "SignalR",
63+
"properties": {
64+
"tls": {
65+
"clientCertEnabled": false
66+
},
67+
"features": [
68+
{
69+
"flag": "ServiceMode",
70+
"value": "Default",
71+
"properties": {}
72+
},
73+
{
74+
"flag": "EnableConnectivityLogs",
75+
"value": "True",
76+
"properties": {}
77+
}
78+
],
79+
"cors": {
80+
"allowedOrigins": [
81+
"*"
82+
]
83+
},
84+
"serverless": {
85+
"connectionTimeoutInSeconds": 30
86+
},
87+
"upstream": {},
88+
"networkACLs": {
89+
"defaultAction": "Deny",
90+
"publicNetwork": {
91+
"allow": [
92+
"ServerConnection",
93+
"ClientConnection",
94+
"RESTAPI",
95+
"Trace"
96+
]
97+
},
98+
"privateEndpoints": []
99+
},
100+
"publicNetworkAccess": "Enabled",
101+
"disableLocalAuth": true,
102+
"disableAadAuth": false
103+
}
104+
}
105+
]
106+
}
107+
```
108+
109+
## Use Azure Policy
110+
111+
You can assign the [Azure SignalR Service should have local authentication methods disabled](https://ms.portal.azure.com/#view/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2Ff70eecba-335d-4bbc-81d5-5b17b03d498f) Azure policy to an Azure subscription or a resource group to enforce disabling of local authentication for all SignalR resources in the subscription or the resource group.
112+
113+
![Screenshot of disabling local auth policy.](./media/howto-disable-local-auth/disable-local-auth-policy.png)
114+
115+
## Next steps
116+
117+
See the following docs to learn about authentication methods.
118+
119+
- [Overview of Azure AD for SignalR](signalr-concept-authorize-azure-active-directory.md)
120+
- [Authenticate with Azure applications](./signalr-howto-authorize-application.md)
121+
- [Authenticate with managed identities](./signalr-howto-authorize-managed-identity.md)
67.8 KB
Loading
63 KB
Loading
77.6 KB
Loading
57.6 KB
Loading
61.7 KB
Loading
59.6 KB
Loading
59.2 KB
Loading

articles/azure-signalr/signalr-concept-authorize-azure-active-directory.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Authorizing requests against SignalR with Azure AD provides superior security an
1717
<a id="security-principal"></a>
1818
*[1] security principal: a user/resource group, an application, or a service principal such as system-assigned identities and user-assigned identities.*
1919

20+
> [!IMPORTANT]
21+
> Disabling local authentication can have following influences.
22+
> - The current set of access keys will be permanently deleted.
23+
> - Tokens signed with access keys will no longer be available.
24+
2025
## Overview of Azure AD for SignalR
2126

2227
When a security principal attempts to access a SignalR resource, the request must be authorized. With Azure AD, access to a resource requires 2 steps.
@@ -82,4 +87,7 @@ To learn more about roles and role assignments, see:
8287

8388
To learn how to create custom roles, see:
8489

85-
- [Steps to create a custom role](../role-based-access-control/custom-roles.md#steps-to-create-a-custom-role)
90+
- [Steps to create a custom role](../role-based-access-control/custom-roles.md#steps-to-create-a-custom-role)
91+
92+
To learn how to use only Azure AD authentication, see
93+
- [Disable local authentication](./howto-disable-local-auth.md)

0 commit comments

Comments
 (0)