Slip
BABetter Auth
•Created by mov ecx, 420 on 4/11/2025 in #help
get env bindings from better auth email function context.
azure also makes it literally so easy to inject my k8 container with envs from vault so I really dont know why I am overcomplicating this. Chat turned out to be enlightening lol
15 replies
BABetter Auth
•Created by mov ecx, 420 on 4/11/2025 in #help
get env bindings from better auth email function context.
Lol but I wanted to be able to point it elsewhere without changing the container
15 replies
BABetter Auth
•Created by mov ecx, 420 on 4/11/2025 in #help
get env bindings from better auth email function context.
I probably should just load my keys into the env of the container instead of grabbing them at runtime
15 replies
BABetter Auth
•Created by mov ecx, 420 on 4/11/2025 in #help
get env bindings from better auth email function context.
I had a similar problem with my db keys being in my azure vault, since better-auth expects credentials at module load time it can cause issues. I created a factory pattern around the better auth route provider on the server side, and passed the promise into the api routes, so at server start it first grabs keys in the promise before returning the server object
Note the CLI will not work with this configuration, but at least the server runs
15 replies
BABetter Auth
•Created by MaveriX89 on 4/7/2025 in #help
New to SaaS Application Building
I have a similar use where I would like to make it dynamic so Im planning to comb through the code at some point and possibly make a plugin to allow dynamic configuration from a db table if its not too complicated but for now deployments just happen at midnight when barely anyone is accessing auth)
14 replies
BABetter Auth
•Created by MaveriX89 on 4/7/2025 in #help
New to SaaS Application Building
The only way to have your application be used with an OIDC provider is if you register an app with your tenant. Youll also pick permissions for your app to request when they login etc. This is done in their OIDC system and its where you get your client id and secret
As far as handling the settings at runtime currently better-auth is not really designed to do that, it needs to know the configuration of each service at module load time to open proper routes etc, its not exactly designed to be dynamic (might be possible with custom plugins I am not sure)
But if you configure more oauth providers you would need to restart the auth server, then when calling login from the client it passes the provider (each of your tenants) to the server and the server would know which oauth flow to route through
14 replies
BABetter Auth
•Created by MaveriX89 on 4/7/2025 in #help
New to SaaS Application Building
I would first read through the concepts pages to understand how better auth handles the authentication flows.
you might not need a plugin at all depending on the data can use the social providers/custom oAuth and the mapProfileToUser
https://www.better-auth.com/docs/concepts/oauth
If your tenants are acting as their own identity provider you can use the custom OAuth Plugin to integrate with their system as long as you have the ability to register an app/ client secret with them
14 replies