Server to server authentication
Hi guys, does anyone have experience with server to server authentication in a T3 setup? I find a lot of great solutions like clerk for user authentication but what if you want IOT devices or external server to be able to connect to your endpoints, Does anyone has any experience? Maybe a tool or technology to advice on?
1 Reply
You will need to pass that logic into the API folder not using trpc
As for how to implement it exactly... you can try next-auth or authjs as they are now with the DB session strategy (this may not work for you usecase), or just implement a simple server yourself
But again, this will have to be done in just api routes
But the logic how you authorize others depends on you
E.g. a server you own could simply call those enpoints with a specific header like origin, or bearer token... And then you validate in the API