Shelly Schwartzer
03/25/2026, 8:04 AMmgmt.jwt.impersonate() to issue a JWT on behalf of a user (for MDM zero-touch login). This returns only a session JWT (no refresh token). We need the user to stay authenticated for days/weeks without interactive login.
1. Is mgmt.jwt.signIn() the right approach for server-side authentication that returns both sessionJwt + refreshJwt? Does it work with a selectedTenant?
2. Is there a way to get a refresh token from mgmt.jwt.impersonate()? The refreshDuration parameter exists on the API -- does it cause a refresh token to be returned?
3. What's the recommended pattern for machine/daemon authentication where a backend needs to issue long-lived tokens for a user without interactive login (the MDM/zero-touch use case)?DevRev
03/25/2026, 8:04 AMmgmt.jwt.impersonate() API does support the refreshDuration parameter , but it returns only a session JWT, not a refresh token. The refreshDuration parameter controls how long the returned JWT is valid, not whether a refresh token is issued.
const resp = await descopeClient.management.jwt.impersonate(
loginId,
impersonatorId,
validateConsent,
customClaims,
selectedTenant,
refreshDuration // Controls JWT validity duration
);
// Returns: { jwt: "session-jwt-only" }
2. Alternative Approaches for Long-Lived Authentication
For your MDM zero-touch use case requiring days/weeks of authentication without interactive login, consider these patterns:
• M2M Authentication: Use client credentials flow with Descope Access Keys for machine-to-machine authentication
• Inbound Apps: Configure OAuth apps for automated workflows and M2M scenarios
• Extended Token Expiration: Configure longer refresh token timeouts at the project or tenant level
3. Recommended Pattern for MDM/Zero-Touch
For backend services issuing long-lived tokens without interactive login:
1. Use M2M authentication with Access Keys for the backend service itself
2. Configure extended token expiration policies for your use case
3. Implement token refresh logic in your backend to maintain sessions
The documentation doesn't cover mgmt.jwt.signIn() specifically, so I'd recommend confirming with Descope support whether this method exists and supports both session + refresh tokens with selectedTenant.
Impersonate User | API Reference | Descope Documentation
M2M Security | Descope Documentation
Inbound Apps | Descope Documentation
Tenant Settings | Descope DocumentationShelly Schwartzer
03/25/2026, 8:05 AMDevRev
03/25/2026, 8:05 AMAtharva Joshi
03/25/2026, 8:17 AMAviad Lichtenstadt
03/25/2026, 8:40 AMShelly Schwartzer
03/25/2026, 9:48 AMShelly Schwartzer
03/25/2026, 9:48 AMShelly Schwartzer
03/25/2026, 9:49 AMAviad Lichtenstadt
03/25/2026, 10:32 AMShelly Schwartzer
03/25/2026, 10:48 AMAviad Lichtenstadt
03/25/2026, 10:49 AMAviad Lichtenstadt
03/25/2026, 12:32 PMShelly Schwartzer
03/25/2026, 2:09 PMAviad Lichtenstadt
03/25/2026, 2:11 PMselectTenant on this API call it not, and we are adding itShelly Schwartzer
03/25/2026, 2:59 PMShelly Schwartzer
03/25/2026, 2:59 PMTal Kapitolnik
03/26/2026, 9:45 AM