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/api-center/authorize-api-access.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ description: Learn how to configure access to APIs in the Azure API Center inven
4
4
author: dlepow
5
5
ms.service: azure-api-center
6
6
ms.topic: how-to
7
-
ms.date: 04/23/2025
7
+
ms.date: 04/25/2025
8
8
ms.author: danlep
9
9
ms.custom:
10
-
# Customer intent: As an API program manager, I want to ... TBD
10
+
# 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.
11
11
---
12
12
13
13
# Authorize access to APIs in your API Center inventory
@@ -39,34 +39,35 @@ You can configure settings to authorize access to APIs in your API center invent
39
39
40
40
## Configure settings for API key authentication
41
41
42
-
Follow these steps to configure settings for API key authentication. The API key must be stored in Azure Key Vault, and access to the key vault is through your API center's managed identity.
42
+
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.
43
43
44
-
### Store secret in Azure Key Vault
44
+
### 1. Store secret in Azure Key Vault
45
45
46
46
To store the API key securely, use Azure Key Vault. You can create a new key vault or use an existing one, using the Azure portal, Azure tools, or Azure SDKs. Your key vault should use the Azure role-based access control (RBAC) permission model.
47
47
48
48
* For steps to create a key vault, see [Create a Key Vault](/azure/key-vault/general/quick-create-portal).
49
49
50
-
* To store the API key as a secret in the Key Vault, see [Set and retrieve secret in Key Vault](/azure/key-vault/secrets/quick-create-portal).
50
+
* To store the API key as a secret in the key vault, see [Set and retrieve secret in Key Vault](/azure/key-vault/secrets/quick-create-portal).
51
51
52
-
Note the *secret identifier* of the secret. 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.
52
+
> [!NOTE]
53
+
> 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.
53
54
54
55
<!-- Should we use the version of the secret in the URI? -->
55
56
56
57
57
-
### Enable a managed identity in your API center
58
+
### 2. Enable a managed identity in your API center
58
59
59
-
For this scenario, your API center uses a [managed identity](/entra/identity/managed-identities-azure-resources/overview) to access Azure resources. Depending on your needs, enable either a system-assigned or one or more user-assigned managed identities.
60
+
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.
60
61
61
-
The following examples show how to enable a system-assigned managed identity by using the Azure portal. At a high level, configuration steps are similar for a user-assigned managed identity.
62
+
The following example shows how to enable a system-assigned managed identity by using the Azure portal. At a high level, configuration steps are similar for a user-assigned managed identity.
62
63
63
64
64
65
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
65
66
1. In the left menu, under **Security**, select **Managed identities**.
66
67
1. Select **System assigned**, and set the status to **On**.
67
68
1. Select **Save**.
68
69
69
-
### Assign the Key Vault Secrets User role to the managed identity
70
+
### 3. Assign the Key Vault Secrets User role to the managed identity
70
71
71
72
Assign your API center's managed identity the **Key Vault Secrets User** role in your key vault. The following steps use the Azure portal.
72
73
@@ -80,7 +81,7 @@ Assign your API center's managed identity the **Key Vault Secrets User** role in
80
81
1. Select **Review + assign**.
81
82
82
83
83
-
### Add API key configuration in your API center
84
+
### 4. Add API key configuration in your API center
84
85
85
86
1. In the [portal](https://azure.microsoft.com), navigate to your key API center.
86
87
1. In the left menu, under **Assets**, select **Authorization (preview)** > **+ Add configuration**.
@@ -98,45 +99,44 @@ Assign your API center's managed identity the **Key Vault Secrets User** role in
98
99
<!-- Which identity providers are supported? Just Entra? -->
99
100
100
101
101
-
Follow these steps to configure settings for OAuth 2.0 authorizationto APIs. You can configure settings for one or both of the following OAuth 2.0 authorization flows:
102
+
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:
102
103
103
104
***Authorization code flow with PKCE (Proof Key for Code Exchange)** - This flow is recommended for authenticating users in mobile and web applications such as the API Center portal.
104
105
***Client credentials flow** - This flow is recommended for machine-to-machine applications that don't require a specific user's permissions to access data, such as background services or daemons.
105
106
106
107
107
-
### Create an OAuth 2.0 app
108
+
### 1. Create an OAuth 2.0 app
108
109
109
-
For OAuth 2.0 authorization, create an app registration in an identity provider, such as the Microsoft Entra tenant associated with your Azure subscription. The exact steps depend on the identity provider you use. The following example shows how to create an app registration in the Microsoft Entra tenant associated with your Azure subscription.
110
+
For OAuth 2.0 authorization, create an app registration in an identity provider, such as the Microsoft Entra tenant associated with your Azure subscription. The exact steps depend on the identity provider you use.
110
111
112
+
The following example shows how to create an app registration in Microsoft Entra ID.
111
113
112
-
Minimally you need to configure:
113
-
114
-
* A client secret for the app registration.
115
-
* Any required scopes for the API.
116
-
* A redirect URI for the app registration, when using the authorization code flow.
114
+
<!-- NOT COMPLETE. What about Redirect URI? How to configure scopes? -->
117
115
118
116
119
117
1. Sign in to the [Azure portal](https://portal.azure.com) with an account with sufficient permissions in the tenant.
120
118
1. Navigate to **Microsoft Entra ID** > **+ New registration**.
121
-
1.On the **Register an application** page, enter your application registration settings:
119
+
1.In the **Register an application** page, enter your application registration settings:
122
120
1. In **Name**, enter a meaningful name for the app.
123
121
1. In **Supported account types**, select an option that suits your scenario, for example, **Accounts in this organizational directory only (Single tenant)**.
124
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`
125
123
1. Select **Register**.
126
-
1.On the left menu, under **Manage**, select **Certificates & secrets**, and then select **+ New client secret**.
124
+
1.In the left menu, under **Manage**, select **Certificates & secrets**, and then select **+ New client secret**.
127
125
1. Enter a **Description**.
128
126
1. Select an option for **Expires**.
129
127
1. Select **Add**.
130
128
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).
130
+
131
+
In the following section, you will need the following values from the app registration:
131
132
132
-
In the following section, you will need the following values:
133
-
134
-
* The **Application (client) ID** and **Directory (tenant) ID** values from the app registration's **Overview** page.
135
-
* The following endpoints on the app registration's **Overview** > **Endpoints** page:
133
+
* The **Application (client) ID** from the app registration's **Overview** page, and the **Client secret** you copied previously.
134
+
* The following endpoint URLs on the app registration's **Overview** > **Endpoints** page:
136
135
***OAuth2.0 authorization endpoint (v2)** - the authorization endpoint for Microsoft Entra ID
137
-
***OAuth 2.0tToken endpoint** - the token URL for Microsoft Entra ID.
136
+
***OAuth 2.0 token endpoint (v2)** - the token URL endpoint for Microsoft Entra ID
137
+
* Any scopes configured for the app registration.
138
138
139
-
### Add OAuth 2.0 authorization in your API center
139
+
### 2. Add OAuth 2.0 authorization in your API center
140
140
141
141
1. In the [portal](https://azure.microsoft.com), navigate to your key API center.
142
142
1. In the left menu, under **Assets**, select **Authorization (preview)** > **+ Add configuration**.
@@ -153,7 +153,7 @@ In the following section, you will need the following values:
153
153
154
154
## Add authentication settings to an API version
155
155
156
-
After configuring settings for an API key or an OAuth 2.0 flow, add the API key or OAuth 2.0 authentication to an API versions in your inventory.
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.
157
157
158
158
1. In the [portal](https://azure.microsoft.com), navigate to your key API center.
159
159
1. In the left menu, under **Assets**, select **APIs**.
@@ -181,7 +181,7 @@ You can limit access to the authentication settings associated with an API to sp
181
181
1. Click **Select**.
182
182
183
183
> [!TIP]
184
-
> You can also remove users or groups from the access policy. In the **Manage access** page, select **Delete** in the context (...) menu for the user or group.
184
+
> You can also remove users or groups from the access policy. In the **Manage access** page, select **Delete** in the context (...) menu for the user or group.
0 commit comments