Migrating MEAN web application (ExpressJS+MongoDB+AngularJS) to Kinde
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 -> ?
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 -> ?