Skip to content

Commit 855e743

Browse files
author
gitName
committed
draft complete
1 parent 8717f8b commit 855e743

File tree

4 files changed

+37
-40
lines changed

4 files changed

+37
-40
lines changed

articles/api-center/authorize-api-access.md

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ ms.custom:
1010
# Customer intent: As an API program manager, I want to store API authorization information in my API center and enable authorized users to test APIs in the API Center portal.
1111
---
1212

13-
# Authorize access to APIs in your API Center inventory
13+
# Authorize access to APIs in your API center
1414

15-
<!-- Is this a governance or inventory feature -->
16-
17-
You can configure settings to authorize access to APIs in your API center inventory. These settings:
15+
You can configure settings to authorize access to APIs in your API center. These settings:
1816

1917
* Enable API authentication using API keys or OAuth 2.0 authorization
2018
* Associate specific authentication methods with specific API versions in your inventory
21-
* Can limit use of API authentication methods to designated users or groups through access policies
19+
* Manage authentication to API versions by designated users or groups through access policies
2220
* Enable authorized users to test APIs directly in the API Center portal
2321

2422
> [!NOTE]
@@ -37,7 +35,7 @@ You can configure settings to authorize access to APIs in your API center invent
3735
* (For OAuth 2.0 authorization using Microsoft Entra ID) Permissions to create an app registration in a Microsoft Entra tenant associated with your Azure subscription.
3836

3937

40-
## Configure settings for API key authentication
38+
## Option 1: Configure settings for API key authentication
4139

4240
For an API that supports API key authentication, follow these steps to configure settings in your API center. The API key must be stored in Azure Key Vault, and access to the key vault is through your API center's managed identity.
4341

@@ -52,9 +50,6 @@ To store the API key securely, use Azure Key Vault. You can create a new key vau
5250
> [!NOTE]
5351
> The *secret identifier* of the secret appears on the secret's details page. This is a URI of the form `https://<key-vault-name>.vault.azure.net/secrets/<secret-name>/<version>`. You need this value when you add the API key configuration in your API center.
5452
55-
<!-- Should we use the version of the secret in the URI? -->
56-
57-
5853
### 2. Enable a managed identity in your API center
5954

6055
For this scenario, your API center uses a [managed identity](/entra/identity/managed-identities-azure-resources/overview) to access the key vault. Depending on your needs, enable either a system-assigned or one or more user-assigned managed identities.
@@ -78,26 +73,23 @@ Assign your API center's managed identity the **Key Vault Secrets User** role in
7873
1. On the **Role** tab, select **Key Vault Secrets User**.
7974
1. On the **Members** tab, in **Assign access to**, select **Managed identity** > **+ Select members**.
8075
1. On the **Select managed identities** page, select the system-assigned managed identity of your API center that you added in the previous section. Click **Select**.
81-
1. Select **Review + assign**.
76+
1. Select **Review + assign** twice.
8277

8378

8479
### 4. Add API key configuration in your API center
8580

86-
1. In the [portal](https://azure.microsoft.com), navigate to your key API center.
81+
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
8782
1. In the left menu, under **Assets**, select **Authorization (preview)** > **+ Add configuration**.
8883
1. In the **Add authorization** page, set the values as follows:
89-
1. Enter a **Title** (name) and optional **Description** for the authorization.
84+
1. Enter a **Title** (name) and optional **Description** for the configuration.
9085
1. In **Security scheme**, select **API Key**.
9186
1. In **API key location**, select how the key is presented in API requests. Available values are **Header** (request header) and **Query** (query parameter).
9287
1. In **API key parameter name**, enter the name of the HTTP header or query parameter that contains the API key. For example, `x-api-key`.
9388
1. In **API key Key Vault secret reference**, enter the URI of the secret in your key vault that contains the API key. This is a URI of the form `https://<key-vault-name>.vault.azure.net/secrets/<secret-name>/<version>`.
9489
1. Select **Create**.
9590

9691

97-
## Configure settings for OAuth 2.0 authorization
98-
99-
<!-- Which identity providers are supported? Just Entra? -->
100-
92+
## Option 2: Configure settings for OAuth 2.0 authorization
10193

10294
For an API that supports OAuth 2.0 authorization, follow these steps to configure authentication settings in your API center. You can configure settings for one or both of the following OAuth 2.0 authorization flows:
10395

@@ -111,71 +103,68 @@ For OAuth 2.0 authorization, create an app registration in an identity provider,
111103

112104
The following example shows how to create an app registration in Microsoft Entra ID.
113105

114-
<!-- NOT COMPLETE. What about Redirect URI? How to configure scopes? -->
115-
116106

117107
1. Sign in to the [Azure portal](https://portal.azure.com) with an account with sufficient permissions in the tenant.
118108
1. Navigate to **Microsoft Entra ID** > **+ New registration**.
119109
1. In the **Register an application** page, enter your application registration settings:
120110
1. In **Name**, enter a meaningful name for the app.
121111
1. In **Supported account types**, select an option that suits your scenario, for example, **Accounts in this organizational directory only (Single tenant)**.
122-
1. Set the **Redirect URI** to **SPA**, and set the URI. Enter the URI of your API Center portal deployment, in the following form: `https://<service-name>.portal.<location>.azure-api-center.ms`
123112
1. Select **Register**.
124113
1. In the left menu, under **Manage**, select **Certificates & secrets**, and then select **+ New client secret**.
125114
1. Enter a **Description**.
126115
1. Select an option for **Expires**.
127116
1. Select **Add**.
128117
1. Copy the client secret's **Value** before leaving the page. You will need it in the following section.
129-
1. Optionally, to configure API scopes for your app registration, see [Configure an application to expose a web API](/entra/identity-platform/quickstart-configure-app-expose-web-apis#add-a-scope).
118+
1. Optionally, add API scopes in your app registration. For more information, see [Configure an application to expose a web API](/entra/identity-platform/quickstart-configure-app-expose-web-apis#add-a-scope).
130119

131120
In the following section, you will need the following values from the app registration:
132121

133122
* The **Application (client) ID** from the app registration's **Overview** page, and the **Client secret** you copied previously.
134123
* The following endpoint URLs on the app registration's **Overview** > **Endpoints** page:
135124
* **OAuth2.0 authorization endpoint (v2)** - the authorization endpoint for Microsoft Entra ID
136125
* **OAuth 2.0 token endpoint (v2)** - the token URL endpoint for Microsoft Entra ID
137-
* Any scopes configured for the app registration.
126+
* **
127+
* Any API scopes configured in the app registration.
138128

139129
### 2. Add OAuth 2.0 authorization in your API center
140130

141-
1. In the [portal](https://azure.microsoft.com), navigate to your key API center.
131+
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
142132
1. In the left menu, under **Assets**, select **Authorization (preview)** > **+ Add configuration**.
143133
1. In the **Add authorization** page, set the values as follows:
144134
1. Enter a **Title** (name) and optional **Description** for the authorization.
145135
1. In **Security scheme**, select **OAuth2**.
146136
1. In **Client ID**, enter the client ID of the app that you created in the previous section.
147137
1. In **Client secret**, enter the client secret of the app that you created in the previous section.
148-
1. In **Authorization URL**, enter the OAuth 2.0 authorization endpoint used by the identity provider.
149-
1. In **Token URL**, enter the OAuth 2.0 token endpoint used by the identity provider.
138+
1. In **Authorization URL**, enter the OAuth 2.0 authorization endpoint for the identity provider.
139+
1. In **Token URL**, enter the OAuth 2.0 token endpoint for the identity provider.
150140
1. In **OAuth2 flow**, select one or both of the OAuth 2.0 flows that you want to use. Available values are **Authorization code (PKCE)** and **Client credentials**.
151-
1. In **Scopes**, optionally enter one or more API scopes that your API supports. Example: `User.Read`
141+
1. In **Scopes**, optionally enter one or more API scopes that your API supports, separated by " ". Example: `User.Read`
152142
1. Select **Create**.
153143

154-
## Add authentication settings to an API version
144+
## Add authentication configuration to an API version
155145

156-
After configuring settings for an API key or an OAuth 2.0 flow, add the API key or OAuth 2.0 authentication method to an API version in your inventory.
146+
After configuring settings for an API key or an OAuth 2.0 flow, add the API key or OAuth 2.0 configuration to an API version in your inventory.
157147

158-
1. In the [portal](https://azure.microsoft.com), navigate to your key API center.
148+
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
159149
1. In the left menu, under **Assets**, select **APIs**.
160150
1. Select an API that you want to associate the authorization with.
161151
1. In the left menu, under **Details**, select **Versions**.
162-
1. Select the API version that you want to add the authentication settings to.
152+
1. Select the API version that you want to add the authentication configuration to.
163153
1. In the left menu, under **Details**, select **Manage Access (preview)** > **+ Add authentication**.
164154
1. In the **Add authentication** page, select an available **Authentication configuration** that you want to associate with the API version.
165155
1. Select **Create**.
166156

167157
> [!NOTE]
168-
> You can add multiple authentication settings to an API version. For example, you can add both API key and OAuth 2.0 authentication settings to the same API version. Similarly, you can add the same authentication settings to multiple API versions.
169-
170-
## Limit access to specific users or groups
158+
> You can add multiple authentication configurations to an API version. For example, you can add both API key and OAuth 2.0 configurations to the same API version. Similarly, you can add the same configurations to multiple API versions.
171159
172-
You can limit access to the authentication settings associated with an API to specific users or groups in your organization. You do this by configuring an access policy that assigns users or groups the **API Center Credential Access Reader** role, scoped to specific authentication settings in the API. This is useful if you want to allow only specific users to test an API in the API Center portal.
160+
## Manage access by specific users or groups
173161

162+
You can manage access to an API version's authentication configuration by specific users or groups in your organization. You do this by configuring an access policy that assigns users or groups the **API Center Credential Access Reader** role, scoped to specific authentication configurations in the API version. This is useful, for example, if you want to allow only specific users to test an API in the API Center portal.
174163

175-
1. In the [portal](https://azure.microsoft.com), navigate to your key API center.
176-
1. Navigate to an API version to which you've added authentication settings (see previous section).
164+
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
165+
1. Navigate to an API version to which you've added an authentication configuration (see previous section).
177166
1. In the left menu, under **Details**, select **Manage Access (preview)**.
178-
1. Select the **Edit access policies** dropdown at the end of the row for the authentication settings you want to limit access to.
167+
1. Select the **Edit access policies** dropdown at the end of the row for the authentication configuration whose access you want to manage.
179168
1. In the **Manage access** page, select **+ Add > Users** or **+ Add > Groups**.
180169
1. Search for and select the users (or groups) that you want to add. You can select multiple items.
181170
1. Click **Select**.
@@ -186,16 +175,24 @@ You can limit access to the authentication settings associated with an API to sp
186175
## Test API in API Center portal
187176

188177

189-
You can test an API with the authentication and access settings in the API Center portal.
178+
You can use the API Center portal to test an API that you configured for authentication and user access.
190179

191180
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
192181
1. In the left menu, under **API Center Portal**, select **Portal settings**.
193182
1. Select **View API Center portal**.
194-
1. In the API Center portal, select an API that you want to test. Ensure that the API has authentication and access settings associated with it.
183+
1. In the API Center portal, select an API that you want to test.
184+
1. Select a version of the API that has an authentication method configured.
185+
1. Under **Options**, select **View documentation**.
186+
:::image type="content" source="media/authorize-api-access/view-api-documentation.png" alt-text="Screenshot of API details in API Center portal.":::
187+
195188
1. Select an operation in the API, and select **Try this API**.
196-
1. In the window that opens, review the authentication settings. If you have access to the API, select **Test** to try the API.
189+
1. In the window that opens, review the authentication settings. If you have access to the API, select **Send** to try the API.
190+
:::image type="content" source="media/authorize-api-access/test-api-operation-small.png" lightbox="media/authorize-api-access/test-api-operation.png" alt-text="Screenshot of testing an API in the API Center portal's test console.":::
191+
192+
1. If the operation is successful, you see the `200 OK` response code and the response body. If the operation fails, you see an error message.
193+
197194

198195
## Related content
199196

200197
* [Set up API Center portal](set-up-api-center-portal.md)
201-
* [Enable and view Azure API Center portal in Visual Studio Code](enable-api-center-portal-vs-code-extension.md)
198+
* [Enable the Azure API Center portal view in Visual Studio Code](enable-api-center-portal-vs-code-extension.md)
125 KB
Loading
120 KB
Loading
127 KB
Loading

0 commit comments

Comments
 (0)