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: 14/umbraco-cms/reference/management-api/production-setup-oauth.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
description: Setup OAuth authorization for Umbraco Management API in local and production environments.
2
+
description: Set up OAuth authorization for Umbraco Management API in local and production environments.
3
3
---
4
4
5
5
# Overview
@@ -24,7 +24,7 @@ This guide will walk through:
24
24
6.[Configuring Authorization in Production](#configuring-authorization-in-production)
25
25
7.[Common Pitfalls and Troubleshooting](#common-pitfalls-and-troubleshooting)
26
26
27
-
# Environment Differences and Challenges
27
+
##Environment Differences and Challenges
28
28
29
29
The Umbraco Management API authorization works seamlessly in non-production environments using tools like Swagger or Postman. However, in production, some key differences and limitations exist:
30
30
@@ -34,7 +34,7 @@ The Umbraco Management API authorization works seamlessly in non-production envi
34
34
35
35
To avoid conflicts and guarantee smooth integration in production, it's crucial to create a custom client and tailor the authorization flow accordingly.
36
36
37
-
# Configuring appsettings.json
37
+
##Configuring appsettings.json
38
38
39
39
To override the default callback URL for OAuth authorization, update the `appsettings.json` file as follows: (this uses client: `umbraco-back-office`)
40
40
@@ -51,15 +51,15 @@ To override the default callback URL for OAuth authorization, update the `appset
51
51
52
52
This configuration specifies a custom callback path for OAuth. However, it may interfere with the default backoffice callback, affecting accessibility.
53
53
54
-
# Setting up Production-Local Authorization
54
+
##Setting up Production-Local Authorization
55
55
56
56
In a production environment, Swagger UI is disabled, and only the `umbraco-back-office` client can be used. This requires a more advanced approach.
57
57
58
-
# Creating a Custom Client ID
58
+
##Creating a Custom Client ID
59
59
60
60
To avoid conflicts with the backoffice, a new client should be created. Below are the steps to set up a custom client using a Minimal API:
61
61
62
-
## Extending `OpenIdDictApplicationManagerBase`
62
+
###Extending `OpenIdDictApplicationManagerBase`
63
63
64
64
Create a new client for production use by extending the `OpenIdDictApplicationManagerBase`.
65
65
@@ -99,11 +99,11 @@ public class CustomApplicationManager : OpenIdDictApplicationManagerBase
99
99
100
100
The above code allows you to define a new custom client. This client will not interfere with the existing `umbraco-back-office` client, ensuring smooth integration and avoiding callback conflicts.
101
101
102
-
# Minimal API Implementation
102
+
##Minimal API Implementation
103
103
104
104
To set up a Minimal API that integrates the custom client, follow these steps:
105
105
106
-
## Creating the Minimal API Application
106
+
###Creating the Minimal API Application
107
107
108
108
Below is a complete setup for using Minimal API to create and manage custom OAuth clients for the Umbraco Management API.
109
109
@@ -169,7 +169,7 @@ public class ClientModel
169
169
170
170
This implementation demonstrates how to use Minimal API to manage OAuth clients dynamically, allowing better integration into production workflows.
171
171
172
-
# Configuring Authorization in Production
172
+
##Configuring Authorization in Production
173
173
174
174
To configure authorization using the custom client:
175
175
@@ -189,8 +189,8 @@ To configure authorization using the custom client:
189
189
190
190
3. Handle token retrieval and secure storage in your application. Store tokens securely to avoid exposure, for instance by using HTTP-only cookies.
191
191
192
-
# Common Pitfalls and Troubleshooting
192
+
##Common Pitfalls and Troubleshooting
193
193
194
-
## Callback Interference with Back Office
194
+
###Callback Interference with Back Office
195
195
196
196
If the `umbraco-back-office` client causes callback conflicts, use a custom client with a distinct redirect URI to prevent overlap with backoffice authentication.
0 commit comments