Skip to content

Commit f0615ad

Browse files
authored
Update howto-authorize-from-application.md
1 parent e146167 commit f0615ad

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/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/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/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

0 commit comments

Comments
 (0)