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
Copy file name to clipboardExpand all lines: articles/azure-web-pubsub/howto-generate-client-access-url.md
+5-17Lines changed: 5 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
27
27
28
28
# [JavaScript](#tab/javascript)
29
29
30
-
1. Follow [./reference-server-sdk-js.md#getting-started] to create a `WebPubSubServiceClient` object `service`
30
+
1. Follow [Getting started with server SDK](./reference-server-sdk-js.md#getting-started) to create a `WebPubSubServiceClient` object `service`
31
31
32
32
2. Generate Client Access URL by calling `WebPubSubServiceClient.getClientAccessToken`:
33
33
* Configure user ID
@@ -53,7 +53,7 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
53
53
54
54
# [C#](#tab/csharp)
55
55
56
-
1. Follow [./reference-server-sdk-csharp#getting-started] to create a `WebPubSubServiceClient` object `service`
56
+
1. Follow [Getting started with server SDK](./reference-server-sdk-csharp#getting-started) to create a `WebPubSubServiceClient` object `service`
57
57
58
58
2. Generate Client Access URL by calling `WebPubSubServiceClient.GetClientAccessUri`:
59
59
* Configure user ID
@@ -79,7 +79,7 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
79
79
80
80
# [Python](#tab/python)
81
81
82
-
1. Follow [./reference-server-sdk-python.md#install-the-package] to create a `WebPubSubServiceClient` object `service`
82
+
1. Follow [Getting started with server SDK](./reference-server-sdk-python.md#install-the-package) to create a `WebPubSubServiceClient` object `service`
83
83
84
84
2. Generate Client Access URL by calling `WebPubSubServiceClient.get_client_access_token`:
85
85
* Configure user ID
@@ -105,7 +105,7 @@ The same Client Access URL can be generated by using the Web PubSub server SDK.
105
105
106
106
# [Java](#tab/java)
107
107
108
-
1. Follow [./reference-server-sdk-java.md#getting-started] to create a `WebPubSubServiceClient` object `service`
108
+
1. Follow [Getting started with server SDK](./reference-server-sdk-java.md#getting-started) to create a `WebPubSubServiceClient` object `service`
109
109
110
110
2. Generate Client Access URL by calling `WebPubSubServiceClient.getClientAccessToken`:
111
111
* Configure user ID
@@ -147,19 +147,7 @@ In real-world code, we usually have a server side to host the logic generating t
147
147
You can enable Azure ADin 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.
148
148
149
149
1. Follow [Authorize from application](./howto-authorize-from-application.md) to enable Azure AD.
150
-
2. Get the Azure AD token with Postman:
151
-
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.
152
-
2. On the **Headers** tab, add **Content-Type** key and `application/x-www-form-urlencoded`for the value.
153
-
3. Switch to the **Body** tab, and add the following keys and values.
154
-
1. Select `x-www-form-urlencoded`.
155
-
2. Add `grant_type` key, and type `client_credentials`for the value.
156
-
3. Add `client_id` key, and paste the value of**Application (client) ID**in the **Overview** tab of the application you created earlier.
157
-
4. Add `client_secret` key, and paste the value of client secret you noted down earlier.
158
-
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 Azure AD token in the `access_token` field.
160
-
161
-

162
-
150
+
2. Follow [Get Azure AD token](./howto-authorize-from-application#use-postman-to-get-the-azure-ad-token) to get the Azure AD token with Postman.
163
151
3. Use the Azure AD token to invoke `:generateToken`with Postman:
164
152
1. For the URI, enter `https://{Endpoint}/api/hubs/{hub}/:generateToken?api-version=2022-11-01`
165
153
2. On the **Auth** tab, select **Bearer Token** and paste the Azure AD token fetched in the previous step
0 commit comments