Exploring Better Auth SSO Plugin – Guidance on authClient.sso.register Usage

I’ve created a sample repository to explore the usage of the Better Auth SSO plugin. While working on it, I was unsure about the appropriate placement and timing for calling authClient.sso.register, especially since invoking this API requires an active user session. Additionally, there is no implementation provided for signInWithTestUser, which added to the confusion. Documentation reference: Better Auth SSO Plugin - Register an OIDC Provider It's worth noting that sensitive information such as clientId and clientSecret should be handled exclusively on the backend. Sample repo: https://github.com/amal-chandran/sso-better-auth If anyone has a production-ready example or further guidance on implementing this correctly, I’d greatly appreciate it!
Single Sign-On (SSO) | Better Auth
Integrate Single Sign-On (SSO) with your application.
Solution:
so the sso plugin is meant to be used by allowing users to register a custom provider that can be used later to authenticate user
Jump to solution
3 Replies
Solution
bekacru
bekacru2d ago
so the sso plugin is meant to be used by allowing users to register a custom provider that can be used later to authenticate user
bekacru
bekacru2d ago
If you need a set of pre-defined providers checkout the generic oauth plugin instead
Amal Chandran
Amal ChandranOP18h ago
Ok, thanks for the clarification. It would be great if you can add the same in docs as well

Did you find this page helpful?