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-management/developer-portal-wordpress-plugin.md
+58-27Lines changed: 58 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: dlepow
6
6
ms.service: api-management
7
7
ms.custom:
8
8
ms.topic: how-to
9
-
ms.date: 07/15/2024
9
+
ms.date: 07/17/2024
10
10
ms.author: danlep
11
11
---
12
12
@@ -83,26 +83,22 @@ In this step, create a new Microsoft Entra app. In later steps, you configure th
83
83
84
84
1. In the left menu, under **Manage**, select **Certificates & secrets** > **+ New client secret**.
85
85
1. Configure settings for the secret and select **Add**. Copy and safely store the secret's **Value** immediately after it's generated. You need this value in later steps to add the application to your API Management instance and app service for authentication.
86
-
1. In the left menu, under **Manage**, select **Expose an API** > **+ Add a scope**.
87
-
88
-
1. Accept the default **Application ID URI** and select **Save and continue**.
89
-
1. Enter a descriptive **Scope name**.
90
-
1. Under **Who can consent?**, select **Admins and users**.
91
-
1. Enter a descriptive **Admin consent display name** and **Admin consent description**.
92
-
1. Confirm that **State** is set to **Enabled**, and select **Add scope**.
86
+
1. In the left menu, under **Manage**, select **Expose an API**. Note the default **Application ID URI**. Optionally add custom scopes if needed.
93
87
94
88
## Step 3: Enable authentication to the app service
95
89
90
+
In this step, add the Microsoft Entra app registration as an identity provider for authentication to the WordPress app service.
91
+
96
92
1. In the [portal](https://portal.azure.com), navigate to the WordPress app service.
97
93
1. In the left menu, under **Settings**, select **Authentication** > **Add identity provider**.
98
94
1. On the **Basics** tab, in **Identity provider**, select **Microsoft**.
99
95
1. Under **App registration**, select **Provide the details of an existing app registration**.
100
96
1. Enter the **Application (client) Id** and **Client secret** from the app registration that you created in the previous step.
101
-
1. In **Issuer URL**, enter a value appropriate for the authentication endpoint of your Azure environment, such as `https://login.microsoftonline.com/<tenant-id>/v2.0` for global Azure. Replace `<tenant-id>` with the **Directory (tenant) Id** from the app registration.
97
+
1. In **Issuer URL**, enter either of the following values for the authentication endpoint: `https://login.microsoftonline.com/<tenant-id>` or `https://sts.windows.net/<tenantid>`. Replace `<tenant-id>` with the **Directory (tenant) Id** from the app registration.
98
+
> [!IMPORTANT]
99
+
> Do not use the version 2.0 endpoint for the issuer URL (URL ending in `/v2.0`).
102
100
1. In **Allowed token audiences**, enter the **Application ID URI** from the app registration. Example: `api://<app-id>`.
103
-
1. Under **Additional checks**, select values appropriate for your environment, for example:
104
-
1. In **Client application requirement**, select **Allow requests from specific client applications**.
105
-
1. In **Tenant requirement**, select **Use default restrictions based on issuer**.
101
+
1. Under **Additional checks**, select values appropriate for your environment, or use the default values.
106
102
1. Accept the default values for the remaining settings and select **Add**.
107
103
108
104
The identity provider is added to the app service.
@@ -114,28 +110,46 @@ Configure the same Microsoft Entra app registration as an identity provider for
114
110
1. In the [portal](https://portal.azure.com), navigate to your API Management instance.
115
111
1. In the left menu, under **Developer portal**, select **Identities** > **+ Add**.
116
112
1. On the **Add identity provider** page, select **Azure Active Directory** (Microsoft Entra ID).
117
-
1. Enter the **Client Id**, **Client secret**, and **Signin tenant** values from the app registration that you created in a previous step.
113
+
1. Enter the **Client Id**, **Client secret**, and **Signin tenant** values from the app registration that you created in a previous step. The **Signin tenant** is the **Directory (tenant) Id** from the app registration.
118
114
1. In **Client library**, select **MSAL**.
119
115
1. Accept default values for the remaining settings and select **Add**.
120
116
1.[Republish the developer portal](developer-portal-overview.md#publish-the-portal) to apply the changes.
121
117
1. Test the authentication by signing into the developer portal at the following URL, substituting the name of your API Management instance: `https://<apim-instance-name>.developer.azure-api.net/signin`. Select the **Azure Active Directory** (Microsoft Entra ID) button at the bottom to sign in.
122
118
123
-
When you open it for the first time, you're prompted to consent to specific permissions.
119
+
When you open it for the first time, you may be prompted to consent to specific permissions.
124
120
121
+
## Step 5: Configure developer portal settings in API Management
122
+
123
+
Update the settings of the developer portal in the API Management instance to enable CORS and to include the app service site as a portal origin.
124
+
125
+
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
126
+
1. In the left menu, under **Developer portal**, select **Portal overview**.
127
+
1. On the **Portal overview** tab, select **Enable CORS**.
128
+
1. In the left menu, under **Developer portal**, select **Portal settings**.
129
+
1. On the **Self-hosted portal configuration** tab, enter the hostname of your WordPress on App Service site as a portal origin, substituting the name of your app service in the following URL: `https://<yourapp-service-name>.azurewebsites.net`
130
+
1.[Republish the developer portal](developer-portal-overview.md#publish-the-portal) to apply the changes.
125
131
126
-
## Step 5: Navigate to WordPress admin site and upload the customized theme
132
+
## Step 6: Navigate to WordPress admin site and upload the customized theme
133
+
134
+
In this step, you upload the customized theme for the API Management developer portal to the WordPress admin site.
135
+
136
+
> [!IMPORTANT]
137
+
> We recommend that you upload the theme provided in the plugin repo. The theme is based on the Twenty Twenty Four theme and is customized to support the developer portal functionality in WordPress. If you choose to use a different theme, some functionality may not work as expected or require additional customization.
127
138
128
139
1. Open the WordPress admin website at the following URL, substituting the name of your app service: `http://<app-service-name>.azurewebsites.net/wp-admin`
129
140
130
-
When you open it for the first time, you're prompted to consent to specific permissions.
141
+
When you open it for the first time, you may be prompted to consent to specific permissions.
131
142
132
143
1. Sign into the WordPress admin site using the username and password that you entered while creating WordPress on App Service.
133
144
1. In the left menu, select **Appearance** > **Themes** and then **Add New Theme**.
134
145
1. Select **Upload Theme**. Select **Choose File** to upload the API Management developer portal theme zip file that you downloaded previously. Select **Install Now**.
135
146
1. In the next screen, select **Replace active with uploaded**.
136
-
1.Select**Activate**.
147
+
1.If prompted, select**Activate**.
137
148
138
-
## Step 6: Install the developer portal plugin
149
+
> [!NOTE]
150
+
> If your WordPress site includes a caching plug-in, clear the cache after activating the theme to ensure that the changes take effect.
151
+
152
+
## Step 7: Install the developer portal plugin
139
153
140
154
1. In the WordPress admin site, in the left menu, select **Plugins** > **Add New Plugin**.
141
155
1. Select **Upload Plugin**. Select **Choose File** to upload the API Management developer portal plugin zip file (`apim-devportal.zip`) that you downloaded previously. Select **Install Now**.
@@ -257,19 +271,14 @@ Add a custom stylesheet for the API Management developer portal.
257
271
1. **Save** the changes. Select**Save** again to save the changes to the theme.
258
272
1. **Log Out** of the WordPress admin site.
259
273
260
-
## Step 9: Add the WordPress site to the list of origins for the developer portal
261
274
262
-
Update the settings of the developer portal in the API Management instance to include the WordPress site as a portal origin.
263
-
264
-
1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
265
-
1. In the left menu, under **Developer portal**, select**Portal settings**.
266
-
1. On the **Self-hosted portal configuration** tab, enter the hostname of your WordPress on App Service site as a portal origin, substituting the name of your app service in the following URL: `https://<yourapp-service-name>.azurewebsites.net`
267
-
1. [Republish the developer portal](developer-portal-overview.md#publish-the-portal) to apply the changes.
268
-
269
-
## Step 10: Sign into the API Management developer portal deployed on WordPress
275
+
## Step 9: Sign into the API Management developer portal deployed on WordPress
270
276
271
277
Sign into the WordPress site to see your new API Management developer portal deployed on WordPress and hosted on App Service.
272
278
279
+
> [!NOTE]
280
+
> You can only sign in to the developer portal on WordPress using Microsoft Entra ID credentials. Basic authentication isn't supported.
281
+
273
282
1. In a new browser window, navigate to your WordPress site, substituting the name of your app service in the following URL: `https://<yourapp-service-name>.azurewebsites.net`
274
283
1. When prompted, sign in using Microsoft Entra ID credentials for a developer account.
275
284
@@ -289,6 +298,28 @@ The following screenshot shows a sample page of the API Management developer por
289
298
290
299
:::image type="content" source="media/developer-portal-wordpress-plugin/portal-wordpress.png" alt-text="Screenshot of the developer portal hosted on WordPress.":::
291
300
301
+
## Troubleshooting
302
+
303
+
### I don't see the latest developer portal pages on the WordPress site
304
+
305
+
If you don't see the latest developer portal pages when you visit the WordPress site, check that the developer portal plugin is installed, activated, and configured in the WordPress admin site. See [Install the developer portal plugin](#step-7-install-the-developer-portal-plugin) for steps.
306
+
307
+
You might also need to clear the cache on your WordPress site or in the CDN, if one is configured. Alternatively, you might need to clear the cache on your browser.
308
+
309
+
### I'm having problems signing in or out of the developer portal
310
+
311
+
If you're having problems signing in or out of the developer portal, clear the browser cache, or view the developer portal site in a separate browser session (using incognito or private browsing mode).
312
+
313
+
### I don't see asign-inbutton on the developer portal navigation bar
314
+
315
+
If you're using a custom theme different from the one provided in the plugin repo, you may need to add the sign-in functionality to the navigation bar manually. On the Home page, add the following shortcode block: `[SignInButton]`. [Learn more](https://wordpress.org/documentation/article/shortcode-block/) in the WordPress documentation.
316
+
317
+
You can also sign in or sign out manually by entering the following URLs in your browser:
0 commit comments