wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
12.79k stars 1.14k forks source link

Make Wasp Auth usable in external apps / services #1973

Open Martinsos opened 2 months ago

Martinsos commented 2 months ago

We have users that are building Wasp app, but they also have some other apps that they want to use the same auth system (Wasp Auth). For example, we had a user building a Unity game, and wanted to have a Wasp app that serves as a dashboard on web for the stuff related for that game. Or we had another user building a Chrome extension. And so on.

Right now, they don't have an easy way to use Wasp Auth in there. They could reverse engineer how Waps auth works and send correct stuff to our server, but they would still have to deal with some client logic on their own, especially in the case of oauth (social providers), and all together it is quite some work.

What we should do is offer SDK for different platforms where we think they might want to do this. So for example, we should generate SDK for C# (which would then work for Unity), and we could also generate SDK for JS, for Java, ... .

I see Firebase having something similar, for example here is their auth for unity: https://firebase.google.com/docs/auth/unity/start .

Related discord convos:

Martinsos commented 1 month ago

And SDK for usage in React Native!

Martinsos commented 1 month ago

@infomiho gave some good insights into this.

First, he says, we should document our server's Auth API, so anybody can implement Auth client that uses it. While doing that, we will want to also tidy it up a bit potentially, make it more flexible if needed and similar.

Then, we can go about creating client Auth SDK's.

I do wonder if we will be publishing those as libraries, on npm and similar, or if we will instead be generating those on the disc from the Wasp project and other projects will use it directly from the disc, since we are generating Auth code -> this will be interesting.

Martinsos commented 1 month ago

Another user needing this! https://discord.com/channels/686873244791210014/1244860963900100608/1245470939068502106 .