Skip to content

Commit 0e380b8

Browse files
authored
docs: add FAQ explaining PKCE incompatibility with IdP-initiated SAML… (supabase#40050)
docs: add FAQ explaining PKCE incompatibility with IdP-initiated SAML and bookmark app alternative
1 parent 0c501d7 commit 0e380b8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/docs/content/guides/auth/enterprise-sso/auth-sso-saml.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,13 @@ export const GET: RequestHandler = async ({ url, locals }) => {
481481
</TabPanel>
482482

483483
</Tabs>
484+
485+
### Why doesn't IdP-initiated SAML flow work with PKCE, and what's the alternative?
486+
487+
Traditional IdP-initiated SAML flows aren't compatible with PKCE (Proof Key for Code Exchange) because PKCE requires a `code_challenge` and `code_verifier` that are generated when your application initiates the authentication flow. In IdP-initiated flows, Supabase receives an unsolicited response without this information, causing the code exchange step to fail.
488+
489+
To achieve the same user experience while maintaining PKCE security, you can implement a "bookmark app" approach:
490+
491+
Create an endpoint in your application (for example, `https://your-app.com/auth/saml-init`) that initiates the SAML flow using `signInWithSSO`. Then create a bookmark or linked application in your IdP that points to this endpoint. When users access the bookmark app, it triggers a secure SP-initiated flow.
492+
493+
This approach supports custom SAML assertions and lets you embed the link anywhere in your application.

0 commit comments

Comments
 (0)