[GH-ISSUE #158] Self-Service Internal IdP with Database-Managed SSO #16784

Closed
opened 2026-04-15 14:45:12 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @KaanMol on GitHub (Oct 13, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/158

Currently, social identity providers (such as Google, Facebook, etc.) are hardcoded into the system. I would like to propose a feature where companies, after creating an account on the platform, can add their own internal Identity Provider (IdP) directly. This would allow users from those companies to authenticate via their internal SSO without requiring any additional deployments from me.

The key difference is that instead of having social configurations hardcoded, they should be stored in the database. A similar approach can be seen in systems like Okta, where companies can integrate their own IdP and users can sign in via SSO. More details on how Okta handles this can be found here: Okta SAML Identity Provider Setup.

As examples, when the feature is implemented, companies could either:

Have a button that says "Sign in with SSO," which prompts the user to enter their company name, looked up in the database to find the appropriate IdP.
Skip the button entirely, and upon entering an email address, the system could automatically match it to the correct company and redirect the user directly to their Identity Provider.
These are flexible options to ensure seamless authentication while allowing companies to configure their IdP without requiring any platform-side deployments.

Please let me know if this is in scope with the idea you have for V1, I have seen multiple issues where people try to use Better-Auth for a SaaS (I also am thinking about switching to it for my SaaS) and a feature like this would be amazing.

Originally created by @KaanMol on GitHub (Oct 13, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/158 Currently, social identity providers (such as Google, Facebook, etc.) are hardcoded into the system. I would like to propose a feature where companies, after creating an account on the platform, can add their own internal Identity Provider (IdP) directly. This would allow users from those companies to authenticate via their internal SSO without requiring any additional deployments from me. The key difference is that instead of having social configurations hardcoded, they should be stored in the database. A similar approach can be seen in systems like Okta, where companies can integrate their own IdP and users can sign in via SSO. More details on how Okta handles this can be found here: [Okta SAML Identity Provider Setup](https://help.okta.com/en-us/content/topics/security/idp-add-saml.htm). As examples, when the feature is implemented, companies could either: Have a button that says "Sign in with SSO," which prompts the user to enter their company name, looked up in the database to find the appropriate IdP. Skip the button entirely, and upon entering an email address, the system could automatically match it to the correct company and redirect the user directly to their Identity Provider. These are flexible options to ensure seamless authentication while allowing companies to configure their IdP without requiring any platform-side deployments. Please let me know if this is in scope with the idea you have for V1, I have seen multiple issues where people try to use Better-Auth for a SaaS (I also am thinking about switching to it for my SaaS) and a feature like this would be amazing.
GiteaMirror added the enhancementlocked labels 2026-04-15 14:45:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#16784