Skip to content

Commit 993c004

Browse files
authored
Merge pull request #228601 from vicancy/patch-4
Update howto-authorize-from-application.md
2 parents ebba391 + dd34a1e commit 993c004

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

articles/azure-web-pubsub/howto-authorize-from-application.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ This sample shows how to assign a `Web PubSub Service Owner` role to a service p
7878

7979
1. Click **Add > Add role assignment**.
8080

81-
1. On the **Roles** tab, select `Web PubSub App Server`.
81+
1. On the **Roles** tab, select `Web PubSub Service Owner`.
8282

8383
1. Click **Next**.
8484

@@ -107,7 +107,31 @@ To learn more about how to assign and manage Azure role assignments, see these a
107107
- [Assign Azure roles using Azure CLI](../role-based-access-control/role-assignments-cli.md)
108108
- [Assign Azure roles using Azure Resource Manager templates](../role-based-access-control/role-assignments-template.md)
109109

110-
## Sample codes
110+
## Use Postman to get the Azure AD token
111+
1. Launch Postman
112+
113+
2. For the method, select **GET**.
114+
115+
3. 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.
116+
117+
4. On the **Headers** tab, add **Content-Type** key and `application/x-www-form-urlencoded` for the value.
118+
119+
![Screenshot of the basic info using postman to get the token.](./media/howto-authorize-from-application/get-azure-ad-token-using-postman.png)
120+
121+
5. Switch to the **Body** tab, and add the following keys and values.
122+
1. Select **x-www-form-urlencoded**.
123+
2. Add `grant_type` key, and type `client_credentials` for the value.
124+
3. Add `client_id` key, and paste the value of **Application (client) ID** in the **Overview** tab of the application you created earlier.
125+
4. Add `client_secret` key, and paste the value of client secret you noted down earlier.
126+
5. Add `resource` key, and type `https://webpubsub.azure.com` for the value.
127+
128+
![Screenshot of the body parameters when using postman to get the token.](./media/howto-authorize-from-application/get-azure-ad-token-using-postman-body.png)
129+
130+
6. Select **Send** to send the request to get the token. You see the token in the `access_token` field.
131+
132+
![Screenshot of the response token when using postman to get the token.](./media/howto-authorize-from-application/get-azure-ad-token-using-postman-response.png)
133+
134+
## Sample codes using Azure AD auth
111135

112136
We officially support 4 programming languages:
113137

@@ -120,4 +144,4 @@ We officially support 4 programming languages:
120144

121145
See the following related articles:
122146
- [Overview of Azure AD for Web PubSub](concept-azure-ad-authorization.md)
123-
- [Authorize request to Web PubSub resources with Azure AD from managed identities](howto-authorize-from-managed-identity.md)
147+
- [Authorize request to Web PubSub resources with Azure AD from managed identities](howto-authorize-from-managed-identity.md)
60.1 KB
Loading
119 KB
Loading
67.1 KB
Loading

0 commit comments

Comments
 (0)