Skip to content

Commit c734146

Browse files
authored
Merge pull request #270612 from garrodonnell/remove-postman-b2c
[B2C] Removing Postman recommendations from Azure AD B2C content.
2 parents e7aad6d + 75cd562 commit c734146

File tree

4 files changed

+6
-109
lines changed

4 files changed

+6
-109
lines changed

articles/active-directory-b2c/access-tokens.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ grant_type=authorization_code
106106
&client_secret=2hMG2-_:y12n10vwH...
107107
```
108108

109-
If you want to test this POST HTTP request, you can use any HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview) or [Postman](https://www.postman.com/).
109+
If you want to test this POST HTTP request, you can use any HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview).
110110

111111
A successful token response looks like this:
112112

articles/active-directory-b2c/authorization-code-flow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ error=access_denied
106106
| state |See the full description in the preceding table. If a `state` parameter is included in the request, the same value should appear in the response. The app should verify that the `state` values in the request and response are identical. |
107107

108108
## 2. Get an access token
109-
Now that you've acquired an authorization code, you can redeem the `code` for a token to the intended resource by sending a POST request to the `/token` endpoint. In Azure AD B2C, you can [request access tokens for other API's](access-tokens.md#request-a-token) as usual by specifying their scope(s) in the request.
109+
Now that you've acquired an authorization code, you can redeem the `code` for a token to the intended resource by sending a POST request to the `/token` endpoint. In Azure AD B2C, you can [request access tokens for other APIs](access-tokens.md#request-a-token) as usual by specifying their scope(s) in the request.
110110

111111
You can also request an access token for your app's own back-end Web API by convention of using the app's client ID as the requested scope (which will result in an access token with that client ID as the "audience"):
112112

@@ -135,7 +135,7 @@ grant_type=authorization_code
135135
| redirect_uri |Required |The redirect URI of the application where you received the authorization code. |
136136
| code_verifier | recommended | The same `code_verifier` used to obtain the authorization code. Required if PKCE was used in the authorization code grant request. For more information, see the [PKCE RFC](https://tools.ietf.org/html/rfc7636). |
137137

138-
If you're testing this POST HTTP request, you can use any HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview) or [Postman](https://www.postman.com/).
138+
If you're testing this POST HTTP request, you can use any HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview).
139139

140140
A successful token response looks like this:
141141

articles/active-directory-b2c/custom-policies-series-call-rest-api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ You need to deploy an app, which serves as your external app. Your custom policy
108108

109109
1. To test the app works as expected, use the following steps:
110110
1. In your terminal, run the `node index.js` command to start your app server.
111-
1. To make a POST request similar to the one shown in this example, you can use an HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview) or [Postman](https://www.postman.com/):
111+
1. To make a POST request similar to the one shown in this example, you can use an HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview).
112112

113113
```http
114114
POST http://localhost/validate-accesscode HTTP/1.1
@@ -147,15 +147,15 @@ At this point, you're ready to deploy your Node.js app.
147147

148148
### Step 1.2 - Deploy the Node.js app in Azure App Service
149149

150-
For your custom policy to reach your Node.js app, it needs to be reachable, so, you need deploy it. In this article, you deploy the app by using [Azure App Service](../app-service/overview-vnet-integration.md), but you use an alternative hosting approach.
150+
For your custom policy to reach your Node.js app, it needs to be reachable, so, you need to deploy it. In this article, you deploy the app by using [Azure App Service](../app-service/overview-vnet-integration.md), but you use an alternative hosting approach.
151151

152152
Follow the steps in [Deploy your app to Azure](../app-service/quickstart-nodejs.md#deploy-to-azure) to deploy your Node.js app to Azure. For the **Name** of the app, use a descriptive name such as `custompolicyapi`. Hence:
153153

154154
- App URL looks similar to `https://custompolicyapi.azurewebsites.net`.
155155

156156
- Service endpoint looks similar to `https://custompolicyapi.azurewebsites.net/validate-accesscode`.
157157

158-
You can test the app you've deployed by using an HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview) or [Postman](https://www.postman.com/). This time, use `https://custompolicyapi.azurewebsites.net/validate-accesscode` URL as the endpoint.
158+
You can test the app you've deployed by using an HTTP client such as [Microsoft PowerShell](/powershell/scripting/overview). This time, use `https://custompolicyapi.azurewebsites.net/validate-accesscode` URL as the endpoint.
159159
160160
## Step 2 - Call the REST API
161161

articles/active-directory-b2c/secure-api-management.md

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Before you begin, make sure that you have the following resources in place:
2929
* An [application that's registered in your tenant](tutorial-register-applications.md)
3030
* [User flows that are created in your tenant](tutorial-create-user-flows.md)
3131
* A [published API](../api-management/import-and-publish.md) in Azure API Management
32-
* (Optional) A [Postman platform](https://www.postman.com/) to test secured access
3332

3433
## Get Azure AD B2C application ID
3534

@@ -114,108 +113,6 @@ You're now ready to add the inbound policy in Azure API Management that validate
114113
<on-error> <base /> </on-error>
115114
</policies>
116115
```
117-
118-
## Validate secure API access
119-
120-
To ensure that only authenticated callers can access your API, you can validate your Azure API Management configuration by calling the API with [Postman](https://www.postman.com/).
121-
122-
To call the API, you need both an access token that's issued by Azure AD B2C and an Azure API Management subscription key.
123-
124-
### Get an access token
125-
126-
You first need a token that's issued by Azure AD B2C to use in the `Authorization` header in Postman. You can get one by using the *Run now* feature of the sign-up/sign-in user flow you that you created as one of the prerequisites.
127-
128-
1. In the [Azure portal](https://portal.azure.com), go to your Azure AD B2C tenant.
129-
1. Under **Policies**, select **User flows**.
130-
1. Select an existing sign-up/sign-in user flow (for example, *B2C_1_signupsignin1*).
131-
1. For **Application**, select *webapp1*.
132-
1. For **Reply URL**, select `https://jwt.ms`.
133-
1. Select **Run user flow**.
134-
135-
![Screenshot of the "Run user flow" pane for the sign-up/sign-in user flow in the Azure portal.](media/secure-apim-with-b2c-token/portal-03-user-flow.png)
136-
137-
1. Complete the sign-in process. You should be redirected to `https://jwt.ms`.
138-
1. Record the encoded token value that's displayed in your browser. You use this token value for the Authorization header in Postman.
139-
140-
![Screenshot of the encoded token value displayed on jwt.ms.](media/secure-apim-with-b2c-token/jwt-ms-01-token.png)
141-
142-
### Get an API subscription key
143-
144-
A client application (in this case, Postman) that calls a published API must include a valid API Management subscription key in its HTTP requests to the API. To get a subscription key to include in your Postman HTTP request:
145-
146-
1. In the [Azure portal](https://portal.azure.com), go to your Azure API Management service instance.
147-
1. Select **Subscriptions**.
148-
1. Select the ellipsis (**...**) next to **Product: Unlimited**, and then select **Show/hide keys**.
149-
1. Record the **Primary Key** for the product. You use this key for the `Ocp-Apim-Subscription-Key` header in your HTTP request in Postman.
150-
151-
![Screenshot of the "Subscription key" page in the Azure portal, with "Show/hide keys" selected.](media/secure-apim-with-b2c-token/portal-04-api-subscription-key.png)
152-
153-
### Test a secure API call
154-
155-
With the access token and Azure API Management subscription key recorded, you're now ready to test whether you've correctly configured secure access to the API.
156-
157-
1. Create a new `GET` request in [Postman](https://www.postman.com/). For the request URL, specify the speakers list endpoint of the API you published as one of the prerequisites. For example:
158-
159-
`https://contosoapim.azure-api.net/conference/speakers`
160-
161-
1. Next, add the following headers:
162-
163-
| Key | Value |
164-
| --- | ----- |
165-
| `Authorization` | The encoded token value you recorded earlier, prefixed with `Bearer ` (include the space after "Bearer") |
166-
| `Ocp-Apim-Subscription-Key` | The Azure API Management subscription key you recorded earlier. |
167-
| | |
168-
169-
Your **GET** request URL and **Headers** should appear similar to those shown in the following image:
170-
171-
![Screenshot of the Postman UI showing the GET request URL and headers.](media/secure-apim-with-b2c-token/postman-01-headers.png)
172-
173-
1. In Postman, select the **Send** button to execute the request. If you've configured everything correctly, you should be given a JSON response with a collection of conference speakers (shown here, truncated):
174-
175-
```json
176-
{
177-
"collection": {
178-
"version": "1.0",
179-
"href": "https://conferenceapi.azurewebsites.net:443/speakers",
180-
"links": [],
181-
"items": [
182-
{
183-
"href": "https://conferenceapi.azurewebsites.net/speaker/1",
184-
"data": [
185-
{
186-
"name": "Name",
187-
"value": "Scott Guthrie"
188-
}
189-
],
190-
"links": [
191-
{
192-
"rel": "http://tavis.net/rels/sessions",
193-
"href": "https://conferenceapi.azurewebsites.net/speaker/1/sessions"
194-
}
195-
]
196-
},
197-
[...]
198-
```
199-
200-
### Test an insecure API call
201-
202-
Now that you've made a successful request, test the failure case to ensure that calls to your API with an *invalid* token are rejected as expected. One way to perform the test is to add or change a few characters in the token value, and then run the same `GET` request as before.
203-
204-
1. Add several characters to the token value to simulate an invalid token. For example, you could add "INVALID" to the token value, as shown here:
205-
206-
![Screenshot of the Headers section of Postman UI showing the string INVALID added to token.](media/secure-apim-with-b2c-token/postman-02-invalid-token.png)
207-
208-
1. Select the **Send** button to execute the request. With an invalid token, the expected result is a `401` unauthorized status code:
209-
210-
```json
211-
{
212-
"statusCode": 401,
213-
"message": "Unauthorized. Access token is missing or invalid."
214-
}
215-
```
216-
217-
If you see a `401` status code, you've verified that only callers with a valid access token issued by Azure AD B2C can make successful requests to your Azure API Management API.
218-
219116
## Support multiple applications and issuers
220117

221118
Several applications typically interact with a single REST API. To enable your API to accept tokens intended for multiple applications, add their application IDs to the `<audiences>` element in the Azure API Management inbound policy.

0 commit comments

Comments
 (0)