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
# SignalR Service input binding for Azure Functions
14
14
15
-
Before a client can connect to Azure SignalR Service, it must retrieve the service endpoint URL and a valid access token. The *SignalRConnectionInfo* input binding produces the SignalR Service endpoint URL and a valid token that are used to connect to the service. Because the token is time-limited and can be used to authenticate a specific user to a connection, you should not cache the token or share it between clients. An HTTP trigger using this binding can be used by clients to retrieve the connection information.
16
-
17
-
For more information on how this binding is used to create a "negotiate" function that can be consumed by a SignalR client SDK, see the [Azure Functions development and configuration article](../azure-signalr/signalr-concept-serverless-development-config.md) in the SignalR Service concepts documentation.
15
+
Before a client can connect to Azure SignalR Service, it must retrieve the service endpoint URL and a valid access token. The *SignalRConnectionInfo* input binding produces the SignalR Service endpoint URL and a valid token that are used to connect to the service. The token is time-limited and can be used to authenticate a specific user to a connection. Therefore, you shouldn't cache the token or share it between clients. Usually you use *SignalRConnectionInfo* with HTTP trigger for clients to retrieve the connection information.
18
16
17
+
For more information on how to use this binding to create a "negotiate" function that is compatible with a SignalR client SDK, see [Azure Functions development and configuration with Azure SignalR Service](../azure-signalr/signalr-concept-serverless-development-config.md).
19
18
For information on setup and configuration details, see the [overview](functions-bindings-signalr-service.md).
20
19
21
20
## Example
@@ -150,7 +149,7 @@ public SignalRConnectionInfo negotiate(
150
149
151
150
### Authenticated tokens
152
151
153
-
When the function is triggered by an authenticated client, you can add a user ID claim to the generated token. You can easily add authentication to a function app using [App Service Authentication](../app-service/overview-authentication-authorization.md).
152
+
When an authenticated client triggers the function, you can add a user ID claim to the generated token. You can easily add authentication to a function app using [App Service Authentication](../app-service/overview-authentication-authorization.md).
154
153
155
154
App Service authentication sets HTTP headers named `x-ms-client-principal-id` and `x-ms-client-principal-name` that contain the authenticated user's client principal ID and name, respectively.
156
155
@@ -320,9 +319,9 @@ The following table explains the properties of the `SignalRConnectionInfo` attri
320
319
|---------|----------------------|
321
320
|**hubName**| Required. The hub name. |
322
321
|**ConnectionStringSetting**| The name of the app setting that contains the SignalR Service connection string, which defaults to `AzureSignalRConnectionString`. |
323
-
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
324
-
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
325
-
|**ClaimTypeList**| Optional. A list of claim types which filter the claims in **IdToken** . |
322
+
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
323
+
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
324
+
|**ClaimTypeList**| Optional. A list of claim types, which filter the claims in **IdToken** . |
326
325
327
326
# [Isolated process](#tab/isolated-process)
328
327
@@ -332,9 +331,9 @@ The following table explains the properties of the `SignalRConnectionInfoInput`
332
331
|---------|----------------------|
333
332
|**hubName**| Required. The hub name. |
334
333
|**ConnectionStringSetting**| The name of the app setting that contains the SignalR Service connection string, which defaults to `AzureSignalRConnectionString`. |
335
-
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
336
-
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
337
-
|**ClaimTypeList**| Optional. A list of claim types which filter the claims in **IdToken** . |
334
+
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
335
+
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
336
+
|**ClaimTypeList**| Optional. A list of claim types, which filter the claims in **IdToken** . |
338
337
339
338
# [C# Script](#tab/csharp-script)
340
339
@@ -347,9 +346,9 @@ The following table explains the binding configuration properties that you set i
347
346
|**name**| Variable name used in function code for connection info object. |
348
347
|**hubName**| Required. The hub name. |
349
348
|**ConnectionStringSetting**| The name of the app setting that contains the SignalR Service connection string, which defaults to `AzureSignalRConnectionString`. |
350
-
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
351
-
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
352
-
|**ClaimTypeList**| Optional. A list of claim types which filter the claims in **IdToken** . |
349
+
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
350
+
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
351
+
|**ClaimTypeList**| Optional. A list of claim types, which filter the claims in **IdToken** . |
353
352
354
353
---
355
354
@@ -366,9 +365,9 @@ The following table explains the supported settings for the `SignalRConnectionIn
366
365
|**name**| Variable name used in function code for connection info object. |
367
366
|**hubName**| Required. The hub name. |
368
367
|**ConnectionStringSetting**| The name of the app setting that contains the SignalR Service connection string, which defaults to `AzureSignalRConnectionString`. |
369
-
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
370
-
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
371
-
|**ClaimTypeList**| Optional. A list of claim types which filter the claims in **IdToken** . |
368
+
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
369
+
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
370
+
|**ClaimTypeList**| Optional. A list of claim types, which filter the claims in **IdToken** . |
372
371
373
372
::: zone-end
374
373
::: zone pivot="programming-language-javascript,programming-language-powershell,programming-language-python"
@@ -382,15 +381,15 @@ The following table explains the binding configuration properties that you set i
382
381
|**direction**| Must be set to `in`.|
383
382
|**hubName**| Required. The hub name. |
384
383
|**ConnectionStringSetting**| The name of the app setting that contains the SignalR Service connection string, which defaults to `AzureSignalRConnectionString`. |
385
-
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
386
-
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to a HTTP request header or query. |
387
-
|**ClaimTypeList**| Optional. A list of claim types which filter the claims in **IdToken** . |
384
+
|**UserId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
385
+
|**IdToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **ClaimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
386
+
|**ClaimTypeList**| Optional. A list of claim types, which filter the claims in **IdToken** . |
As SignalR input binding is usually used together with HTTP trigger, and the values of some attributes of SignalR input binding usually come from HTTP requests, we'll show how to bind values from HTTP requests to SignalR input binding attributes via [binding expression](./functions-bindings-expressions-patterns.md#trigger-metadata).
392
+
It's a common scenario that the values of some attributes of SignalR input binding come from HTTP requests. Therefore, we show how to bind values from HTTP requests to SignalR input binding attributes via [binding expression](./functions-bindings-expressions-patterns.md#trigger-metadata).
394
393
395
394
| HTTP metadata type | Binding expression format | Description | Example |
0 commit comments