I want to integrate a username+password along with google SSO in my web application. My frontend is built using AngularJS My backend is built using ExpressJS I also store my data in MongoDB I have a custom login page, in which I can either let the user connect via their username & password or they can Continue with Google.
Here's additional info regarding my app: There are 3 user roles - admin, roleA, roleB roleA can create roleB users, meaning they can create a username/password for them to login with Only admin can create roleA users There shouldn't be a sign up/register options, so a user (roleA or roleB) can only sign/log in if they have a username & password (or later with Google SSO)
Currently: 1) When a user logs in via their username & password, a JWT token is generated and stored in their user document in the database. 2) The backend responds with the user role + token which is stored in the localStorage in the Frontend. 3) Every request from the frontend contains the token in the headers (as bearer) and the backend verifies it using a middleware.
How do I migrate this process to Kinde? I tried asking KindeAI, but it confused me a bit
Couple of questions: 1) Do I need to add an application for both the Backend and Frontend? If so, which "technology" do I use for the Frontend application? 2) Since I have a custom login page, and I want my backend to handle requests. Is there anything special I need to do in the frontend with regards to Kinde SDK/API calls? 3) How do I setup Kinde in my backend if I have my main entry point app.js call a function in another script (routers/index.js) to initialize (app.use) all endpoints? 4) What do I need to do for a user to be able to login? The flow is: User logs in via frontend -> frontend sends request to BACKEND_URL/login with username + password -> ?
I personally would use Kinde on the backend with the Express SDK and then then handle storing the token in localStorage on the front end. There is a community Kinde Angular SDK https://github.com/luukhaijes/kinde-angular, or you can use the TS/JS SDK if you choose to go down that path.
If it doesn't work, would it be possible to setup a 15-30 minutes video meeting so that I can demonstrate my problems, and maybe that would simplify matters?