thank you so much andy ![]()
thank you so much andy ![]()
thanks andy, i have a question what if i have registration and login table in sql database? in login table i have login id,username,and password. for the username and password did i have to create query? for example select from registration table for password and username? sorry for noob question
Thats what I have, a table for username and password etc.
I'm not really too sure how to answer the question. Have you set up DreamFactory so that it responds with requests for the username/password table?
The way I implemented the username/password was to allow new users to request login, I wrote a script in DreamFactory that then sent a PIN code to the user's email that they were registering with.
The user then had to enter the PIN on the mobile app to confirm their email address and then the app would allow them to set a password - all this was stored in the SQL database.
If you haven't already, maybe you would be best starting with the ApperyDB solution and mastering the REST calls from that?
Basically, I had a SQL DB for usernames and passwords and then attached to production SQL databases for real time data etc.
I just created separate REST Services for each step.
Sorry if this isn't detailed enough, it's difficult to answer without knowing how DreamFactory is setup.
okay, no i'm not using dreamfactory, i'm using api express that are provided by appery.io
means u're using script for login right? i'm using appery db before this to create login and registration but my studies requirement not allow me to use appery db and ask me to use sql database
so i just follow how the login service works with appery db and try to do it for sql database,unfortunately ,its not working.
i'm not sure did i have to do the script on the database or on appery. so that's why i'm quite confuse,with appery db doesn't need any code
i'm just thinking should i make username and password in login table as a foreign key from registration table? i don't know it gonna work or not
thanks andy for ur time.
Ah, ok.
I dont think you need to use a script, simply a query via rest.
If you have the username/password already in a SQL table you can simply query against that, passing both username and password as a GET to the userID table. If nothing is returned, then either the username or password dont match - ie, login denied.
Before this though, you need to have a master username/password for the application that has rights to the DB. Before the user does anything, simply use the logon REST call to your DB with the master username/password to get a SessionID.
Hope that helps, it shouldn't make much difference what back-end you use/
ok andy,
means i have user table and user login table,in user i have id ,username,fullname,password,email,and phone number and in user login i have login id,username and password.
that's means i have to write query at rest service to match the user and user login table?
Hi Nisa,
yes, the initial login will be with a fixed username/password that gives a session ID to allow access to your user's database (with usernames and passwords).
You can then query the entered username/password as you mentioned above
using the session ID created with your master login.