Esakkipandi Esakkimuthu
03/11/2026, 9:28 PMDevRev
03/11/2026, 9:29 PMSameSite=Strict on <http://api.descope.com|api.descope.com> . When navigating from your app domain to <http://api.descope.com|api.descope.com>, browsers don't send the cookie cross-site, causing Descope to see no active session.
Solutions
1. Custom Domain (Recommended)
Set up a custom domain with CNAME pointing to <http://cname.descope.com|cname.descope.com> (US) or <http://CNAME.euc1.descope.com|CNAME.euc1.descope.com> (EU) . This ensures session cookies work across your domain.
# DNS Configuration
<http://auth.yourapp.com|auth.yourapp.com> CNAME <http://cname.descope.com|cname.descope.com>
Configure in Descope Console under Project Settings > Custom Domain.
2. Alternative Approaches
Unfortunately, there are no supported query parameters or API endpoints to bypass the browser session requirement for IdP-initiated flows. The IdP-initiated URL must validate an existing browser session .
3. Workaround Options
• Use SP-initiated SSO instead — redirect users to your app's login page, which then initiates SAML authentication
• Implement a server-side proxy that handles the SAML initiation with proper session management
• Consider switching to OIDC if your SP supports it, as it may offer more flexibility
The custom domain setup is the only supported solution for your IdP-initiated SSO scenario with existing sessions.
Refresh Token Storage in Project | Descope Documentation
IdP-Initiated SSO Configuration | Descope DocumentationEsakkipandi Esakkimuthu
03/11/2026, 9:37 PMDevRev
03/11/2026, 9:37 PM/v1/auth/saml/authorize endpoint exists , but it requires an existing browser session.
Alternative Workaround
Since custom domain isn't feasible, consider this server-side approach:
Backend Proxy Solution
// Your backend endpoint
<http://app.post|app.post>('/saml-proxy', async (req, res) => {
const { userId, samlAppId } = req.body;
// 1. Generate embedded link for user
const embeddedResp = await descopeClient.management.user.generateEmbeddedLink(
userId,
{ timeout: 300 } // 5 minutes
);
// 2. Create redirect URL with embedded token
const redirectUrl = `<https://yourapp.com/saml-handler?t=${embeddedResp.token}&app=${samlAppId}`;>
res.json({ redirectUrl });
});
Frontend Handler
// /saml-handler page
useEffect(() => {
const urlParams = new URLSearchParams(window.location.search);
const token = urlParams.get('t');
const appId = urlParams.get('app');
if (token) {
// Verify embedded link to establish session
descopeClient.magicLink.verify(token).then(() => {
// Now redirect to IdP-initiated URL with session
window.location.href = `<https://api.descope.com/v1/auth/saml/idp/initiate?app=${appId}`;>
});
}
}, []);
This uses the Management SDK's generateEmbeddedLink function to create a server-side session token, then verifies it client-side to establish the browser session before SAML initiation.
Creating SAML redirect URI | API Reference | Descope Documentation
Generate Embedded Link | API Reference | Descope DocumentationEsakkipandi Esakkimuthu
03/11/2026, 9:43 PMDevRev
03/11/2026, 9:43 PMgenerateEmbeddedLink
The Management SDK's generateEmbeddedLink function works at the project level and only requires the user's loginId (email/phone/userId) . No tenant ID needed.
2. No special tenant setup required
The embedded link approach bypasses tenant-specific SAML configurations. It creates a project-level session that works across all tenants.
Updated Implementation
// Backend - no tenant ID needed
<http://app.post|app.post>('/saml-proxy', async (req, res) => {
const { userEmail, samlAppId } = req.body;
// Generate embedded link (project-level, no tenant required)
const embeddedResp = await descopeClient.management.user.generateEmbeddedLink(
userEmail, // loginId - can be email, phone, or userId
{ timeout: 300 }
);
const redirectUrl = `<https://yourapp.com/saml-handler?t=${embeddedResp.token}&app=${samlAppId}`;>
res.json({ redirectUrl });
});
Key Points
• Embedded links work at the project level, not tenant level
• User sessions established via embedded links work with any SAML application in your project
• No tenant-specific SSO configuration needed for this workaround
The solution bypasses the tenant SSO layer entirely by establishing a project-level session first.
Verify Token | API Reference | Descope Documentation
SSO Management API | Descope DocumentationEsakkipandi Esakkimuthu
03/16/2026, 5:45 AM<http://api.descope.com|api.descope.com>
how to do?