Skip to content

Commit 93cf8d3

Browse files
committed
fix syntax
1 parent 91d10d1 commit 93cf8d3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

articles/azure-web-pubsub/howto-generate-client-access-url.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ ms.topic: how-to
1111

1212
# How to generate client access URL for the clients
1313

14-
A client, be it a browser 💻, a mobile app 📱, or an IoT device 💡, uses a **Client Access URL** to connect and authenticate with your resource. This URL follows a pattern of `wss://<service_name>.webpubsub.azure.com/client/hubs/<hub_name>?access_token=<token>`. This artcile shows you several ways to get the Client Access URL.
14+
A client, be it a browser 💻, a mobile app 📱, or an IoT device 💡, uses a **Client Access URL** to connect and authenticate with your resource. This URL follows a pattern of `wss://<service_name>.webpubsub.azure.com/client/hubs/<hub_name>?access_token=<token>`. This article shows you several ways to get the Client Access URL.
1515

1616
- For quick start, copy one from the Azure portal
1717
- For development, generate the value using [Web PubSub server SDK](./reference-server-sdk-js.md)
18-
- If you are using Azure AD, you can also invoke the [Generate Client Token REST API](/rest/api/webpubsub/dataplane/web-pub-sub/generate-client-token)
18+
- If you're using Azure AD, you can also invoke the [Generate Client Token REST API](/rest/api/webpubsub/dataplane/web-pub-sub/generate-client-token)
1919

2020
## Copy from the Azure portal
21-
In the Keys tab in Azure portal, there is a Client URL Generator tool to quickly generate a Client Access URL for you, as shown in the following diagram. Please note that values input here are not stored.
21+
In the Keys tab in Azure portal, there's a Client URL Generator tool to quickly generate a Client Access URL for you, as shown in the following diagram. Values input here aren't stored.
2222

2323
![The diagram shows how to get client access url.](./media/howto-websocket-connect/generate-client-url.png)
2424

@@ -46,7 +46,7 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
4646
```js
4747
let token = await serviceClient.getClientAccessToken({ roles: ["webpubsub.sendToGroup.group1"] });
4848
```
49-
* Configure a group `group1` that the client will join once it connects using this Client Access URL
49+
* Configure a group `group1` that the client joins once it connects using this Client Access URL
5050
```js
5151
let token = await serviceClient.getClientAccessToken({ groups: ["group1"] });
5252
```
@@ -72,7 +72,7 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
7272
```csharp
7373
var url = service.GetClientAccessUri(roles: new string[] { "webpubsub.sendToGroup.group1" });
7474
```
75-
* Configure a group `group1` that the client will join once it connects using this Client Access URL
75+
* Configure a group `group1` that the client joins once it connects using this Client Access URL
7676
```csharp
7777
var url = service.GetClientAccessUri(groups: new string[] { "group1" });
7878
```
@@ -98,7 +98,7 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
9898
```python
9999
token = service.get_client_access_token(roles=["webpubsub.sendToGroup.group1"])
100100
```
101-
* Configure a group `group1` that the client will join once it connects using this Client Access URL
101+
* Configure a group `group1` that the client joins once it connects using this Client Access URL
102102
```python
103103
token = service.get_client_access_token(groups=["group1"])
104104
```
@@ -132,22 +132,22 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
132132
option.addRole("webpubsub.sendToGroup.group1");
133133
WebPubSubClientAccessToken token = service.getClientAccessToken(option);
134134
```
135-
* Configure a group `group1` that the client will join once it connects using this Client Access URL
135+
* Configure a group `group1` that the client joins once it connects using this Client Access URL
136136
```java
137137
GetClientAccessTokenOptions option = new GetClientAccessTokenOptions();
138138
option.setGroups(Arrays.asList("group1")),
139139
WebPubSubClientAccessToken token = service.getClientAccessToken(option);
140140
```
141141
---
142142

143-
In real-world code, we usually have a server side to host the logic generating the Client Access URL. When a client request comes in, the server side can leverage the general authentication/authorization workflow to validate the client request. Only valid client requests can get the Client Access URL back.
143+
In real-world code, we usually have a server side to host the logic generating the Client Access URL. When a client request comes in, the server side can use the general authentication/authorization workflow to validate the client request. Only valid client requests can get the Client Access URL back.
144144

145145
## Invoke the Generate Client Token REST API
146146

147-
You can enable Azure AD in your service and use the AAD token to invoke [Generate Client Token rest API](/rest/api/webpubsub/dataplane/web-pub-sub/generate-client-token) to get the token for the client to use.
147+
You can enable Azure AD in your service and use the Azure AD token to invoke [Generate Client Token rest API](/rest/api/webpubsub/dataplane/web-pub-sub/generate-client-token) to get the token for the client to use.
148148

149149
1. Follow [Authorize from application](./howto-authorize-from-application.md) to enable Azure AD.
150-
2. Get the AAD token with Postman:
150+
2. Get the Azure AD token with Postman:
151151
1. For the URI, enter `https://login.microsoftonline.com/<TENANT ID>/oauth2/token`. Replace `<TENANT ID>` with the **Directory (tenant) ID value** in the **Overview** tab of the application you created earlier.
152152
2. On the **Headers** tab, add **Content-Type** key and `application/x-www-form-urlencoded` for the value.
153153
3. Switch to the **Body** tab, and add the following keys and values.
@@ -156,13 +156,13 @@ You can enable Azure AD in your service and use the AAD token to invoke [Generat
156156
3. Add `client_id` key, and paste the value of **Application (client) ID** in the **Overview** tab of the application you created earlier.
157157
4. Add `client_secret` key, and paste the value of client secret you noted down earlier.
158158
5. Add `resource` key, and type `https://webpubsub.azure.com` for the value.
159-
4. Select **Send** to send the request to get the token. You see the AAD token in the `access_token` field.
159+
4. Select **Send** to send the request to get the token. You see the Azure AD token in the `access_token` field.
160160

161161
![The diagram shows how to get Azure AD token using postman.](./media/howto-generate-client-access-url/get-azure-ad-token-using-postman-response.png)
162162

163-
3. Use the AAD token to invoke `:generateToken` with Postman:
163+
3. Use the Azure AD token to invoke `:generateToken` with Postman:
164164
1. For the URI, enter `https://{Endpoint}/api/hubs/{hub}/:generateToken?api-version=2022-11-01`
165-
2. On the **Auth** tab, select **Bearer Token** and paste the AAD token fetched in the previous step
165+
2. On the **Auth** tab, select **Bearer Token** and paste the Azure AD token fetched in the previous step
166166
3. Select **Send** and you see the Client Access Token in the response:
167167
```json
168168
{

0 commit comments

Comments
 (0)