Skip to content

Commit 022e7a6

Browse files
committed
Update
1 parent 92ae596 commit 022e7a6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

articles/azure-web-pubsub/reference-cloud-events.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,21 @@ ce-eventName: connect
117117
* `204`: Success, with no content.
118118
* `200`: Success, the content SHOULD be a JSON format, with following properties allowed:
119119
* `subprotocols`
120+
120121
The `connect` event forwards the subprotocol and authentication information to Upstream from the client. Web PubSub service uses the status code to determine if the request will be upgraded to WebSocket protocol.
121122

122123
If the request contains the `subprotocols` property, the server should return one subprotocol it supports. If the server doesn't want to use any subprotocols, it should **not** send the `subprotocol` property in response. [Sending a blank header is invalid](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols).
123124

124125
* `userId`: `{auth-ed user ID}`
126+
125127
As the service allows anonymous connections, it's the `connect` event's responsibility to tell the service the user ID of the client connection. The service reads the user ID from the response payload `userId` if it exists. The connection is dropped if the user ID can't be read from the request claims nor the `connect` event's response payload.
128+
126129
* `groups`: `{groups to join}`
130+
127131
The property provides a convenient way for user to add this connection to one or multiple groups. In this way, there's no need to have another call to add this connection to some group.
132+
128133
* `roles`: `{roles the client has}`
134+
129135
The property provides a way for the upstream Webhook to authorize the client. There are different roles to grant initial permissions for PubSub WebSocket clients. Details about the permissions are described in [Client permissions](./concept-client-protocols.md#permissions).
130136

131137
```HTTP

0 commit comments

Comments
 (0)