• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
adding a Login Card to an existing Application
#1
I struggled with this task, so I created another way of doing this.
This is a two-step process.
The first thing that I did was to create a new project called "Generic Login.
I did not add any keys when I did this. The New Project that was created had only 2 keys - cdbUsers and cdbBlobs. and that was all.
I saved this project.
Now, to incorporate this card into the existing project, I opened LiveCode with the existing project that needed a Login Card.
Next, I opened the Generic Login stack. The next step jus requires that you open the Message Box in LiveCode. Make sure that the Login Card is opened. Type "copy this card to the stack "target stack" 
The Login Card is now loaded into your Project that needs the login Card.
Once the Generic Login Stack is created, you no longer need to do this step. You will always have this stack.
This does not need to be done on a New Project, becuase the LogIn is included in creating a New Project in the LCM.

I am not sure if this is the most efficient method and I am open to suggestions.
  Reply
#2
Clarence, this is a good solution.
  Reply
#3
you have an option to add to the script for utilizing Local only data.

for a stand alone Application. This code can be remarked out to provide an option for using Local data or cloud. You use whichever code you need.

--on openCard
--local tStatusA
-
-- get cdb_auth("user@default.com", "password", "user")

--if not cdb_result() then
-- answer "There was a problem authorizing user: " & cdb_result("response")
-- else
-- put cdb_authStatus() into tStatusA

--if tStatusA["local"] is true then
-- cdb_loadTable

-- #Your user can now use the app offline
-- #Now you can go to the next card or show the UI after the login is successful
-- else
-- #You shouldn't fall into this case but I like having it for sanity check
-- answer "You do not have access to the app offline."
--end if
--end if
-- end openCard

thanks efrain for provicing this code.
  Reply
#4
In interest of security, we applied the same details to local databases as we did for cloud databases.

Using a dummy account for now is actually a good solution. It is secure and it does not require any internet connectivity.

For the time being, you need internet only to set up your project, tables, and keys online. While there, create a dummy account in the cdbUsers table. Export your toolkit. You should be good to go using the code provided by Clarence and Efrain.
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)