Jacob Dedman
03/09/2026, 8:59 PM/v1/mgmt/user/search?tenant=my_tenant with error responses:
{
"errorCode": "E111001",
"errorDescription": "Management key is required",
"errorMessage": "Invalid authentication for management request",
"message": "Invalid authentication for management request"
}
I'm only seeing this in our staging environment, not prod or dev when using the same package version. I also have the same structure and permissions for roles and tenants across all environments. I have also confirmed my logged in user has SSO Admin, Impersonate, and User Admin permissions.
What else should I look at to troubleshoot this? The frontend doesn't get a management key, so I assume this error is related to permissions of the logged in user. But as far as I can see my user has all permissions needed. Any help would be much appreciated!DevRev
03/09/2026, 8:59 PMBearer <PROJECT_ID>:<MANAGEMENT_KEY>
// Backend endpoint to proxy widget requests
<http://app.post|app.post>('/api/user-search', async (req, res) => {
const response = await fetch('<https://api.descope.com/v1/mgmt/user/search>', {
method: 'POST',
headers: {
'Authorization': `Bearer ${PROJECT_ID}:${MANAGEMENT_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(req.body)
});
res.json(await response.json());
});
Environment-Specific Troubleshooting
Since this only affects staging:
• Verify your staging backend has the correct management key configured
• Check if the management key is expired or missing in staging environment variables
• Confirm the management key has access to the staging project
User permissions (SSO Admin, User Admin, Impersonate) control what actions users can perform within the widget, but don't authenticate the underlying API calls .
User Management API | Descope Documentation
FedRAMP Security Admin Guide | Descope DocumentationJacob Dedman
03/09/2026, 9:16 PMDevRev
03/09/2026, 9:17 PM<UserManagement
widgetId="user-management-widget"
tenant="my_tenant"
baseUrl="https://your-staging-backend.com" // Ensure this matches staging
/>
Staging-Specific Issues to Check
1. Backend URL mismatch - Widget might be calling prod backend instead of staging
2. CORS configuration - Staging backend may not allow widget requests
3. Environment variables - Management key might be missing in staging deployment
// Verify staging backend has management key
console.log('Management key configured:', !!process.env.DESCOPE_MANAGEMENT_KEY);
// Check if widget requests reach your backend
app.use('/api/mgmt/*', (req, res, next) => {
console.log('Widget request received:', req.path);
next();
});
Debug Steps
1. Check browser network tab - are widget requests reaching your staging backend?
2. Verify staging backend logs show incoming requests from the widget
3. Test your management key directly against the staging environment
The widget should never make direct API calls to Descope - all management operations must go through your authenticated backend.Jacob Dedman
03/09/2026, 9:35 PMDevRev
03/09/2026, 9:36 PM// Required backend endpoints for UserManagement widget
<http://app.post|app.post>('/api/mgmt/user/search', async (req, res) => {
const response = await fetch('<https://api.descope.com/v1/mgmt/user/search>', {
method: 'POST',
headers: {
'Authorization': `Bearer ${PROJECT_ID}:${MANAGEMENT_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(req.body)
});
res.json(await response.json());
});
<http://app.post|app.post>('/api/mgmt/user/create', async (req, res) => {
// Similar proxy for user creation
});
Why Only Staging Fails
Your staging environment likely lacks these proxy endpoints, while prod/dev have them implemented. The widget can create users because that might use a different API path that's already proxied.
Check if your staging deployment includes all the management API proxy endpoints that the widget requires.Jacob Dedman
03/09/2026, 9:37 PMDevRev
03/09/2026, 9:37 PMJacob Dedman
03/09/2026, 9:42 PMDevRev
03/09/2026, 9:42 PMAditya Arakal
03/09/2026, 10:53 PM