[GH-ISSUE #2823] Feature Request: Preset-Based SSO Provider Configuration via Environment Variables #9362

Closed
opened 2026-04-13 04:48:04 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @codersaadi on GitHub (May 29, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2823

Is this suited for github?

  • Yes, this is suited for github

we have been using next auth (Authjs) for a long time.
we have some workarounds , configuration for the presets of sso providers fully controlled from the environment variables which is a very nice feature

if we could introduce presets to better auth , it will improve the developer experience where developers only have to add the environment variables to use the auth provider , idp , or X feature.

Describe the solution you'd like

In auth js we were using these custom implementations with a dedicated typesafe env (t3 env)

export const ssoProviders = [
  Auth0,
  Authentik,
  AzureAD,
  GenericOIDC,
  Github,
  Zitadel,
  Authelia,
  Logto,
  CloudflareZeroTrust,
  Casdoor,
  MicrosoftEntraID,
  WeChat,
  Keycloak,
];

the idea is to write dry code , common config , and using SRP (Single Responsibility Principe)
could pass it like that from the env to use the presets
AUTH_PROVIDERS="zitadel,github"

Benefit : Easy for DevOps to manage auth configuration via .env.
Testing will become easier.
for SaaS templates, white-labeled apps, or multi-tenant platforms.

Describe alternatives you've considered

Better Auth already supports plugins, which could technically be used to create custom providers or dynamically load them based on environment variables
but not ideal for quick onboarding or common use cases.
Good for extensibility,
Not optimized for DX or common SSO cases.

Additional context

I'll be happy to have some info about the current ecosystem

Originally created by @codersaadi on GitHub (May 29, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2823 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. we have been using next auth (Authjs) for a long time. we have some workarounds , configuration for the presets of sso providers fully controlled from the environment variables which is a very nice feature if we could introduce presets to better auth , it will improve the developer experience where developers only have to add the environment variables to use the auth provider , idp , or X feature. ### Describe the solution you'd like In auth js we were using these custom implementations with a dedicated typesafe env (t3 env) ``` export const ssoProviders = [ Auth0, Authentik, AzureAD, GenericOIDC, Github, Zitadel, Authelia, Logto, CloudflareZeroTrust, Casdoor, MicrosoftEntraID, WeChat, Keycloak, ]; ``` the idea is to write dry code , common config , and using SRP (Single Responsibility Principe) could pass it like that from the env to use the presets AUTH_PROVIDERS="zitadel,github" Benefit : Easy for DevOps to manage auth configuration via .env. Testing will become easier. for SaaS templates, white-labeled apps, or multi-tenant platforms. ### Describe alternatives you've considered Better Auth already supports plugins, which could technically be used to create custom providers or dynamically load them based on environment variables but not ideal for quick onboarding or common use cases. ✅ Good for extensibility, ❌ Not optimized for DX or common SSO cases. ### Additional context I'll be happy to have some info about the current ecosystem
GiteaMirror added the locked label 2026-04-13 04:48:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 28, 2025):

Hi, @codersaadi. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested a feature to enable preset-based SSO provider configuration via environment variables, similar to Authjs.
  • The goal is to simplify developer experience for common SSO setups, improving DevOps, testing, and onboarding.
  • You noted that while plugin support exists, it is less ideal for quick or common scenarios.
  • There has been no further activity or discussion on this request since it was opened.

Next Steps:

  • Please let me know if this feature request is still relevant to the latest version of better-auth by commenting on this issue.
  • If I do not hear back within 7 days, I will automatically close this issue.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3234090705 --> @dosubot[bot] commented on GitHub (Aug 28, 2025): Hi, @codersaadi. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested a feature to enable preset-based SSO provider configuration via environment variables, similar to Authjs. - The goal is to simplify developer experience for common SSO setups, improving DevOps, testing, and onboarding. - You noted that while plugin support exists, it is less ideal for quick or common scenarios. - There has been no further activity or discussion on this request since it was opened. **Next Steps:** - Please let me know if this feature request is still relevant to the latest version of better-auth by commenting on this issue. - If I do not hear back within 7 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#9362