Understanding authentication

Discussions regarding developing applications using Servoy Mobile (new in Servoy 7)

Understanding authentication

Postby johann.agcanas » Thu Oct 10, 2013 1:25 am

Hi everyone,

I'm quite new to the Servoy framework and have been tasked with converting an existing Servoy Solution into a Servoy Mobile Solution.
However I'm very stuck with loading the database onto the mobile client. I can easily get the mobile sample working on a mobile device, but I cannot for the life of me figure out how authentication works. This is a major problem as I cannot even get started on my project as I cannot get any data to be loaded. I wanted to try creating a test mobile solution without any authentication (just pull data straight down), but the Programming guide for Servoy Mobile doesn't have any information on how to do this, despite it implying that user specific data is optional.

In servoy_sample_mobile_service, offline_data.js contains a hardcoded userid of 'yboomATservoy.com', which corresponds with a record on the contacts table. Now when I change that userid to another e-mail address existing in the table (such as bcusickATservoy.com for example), no data is pulled down.
In debug mode, everything seems to run identical to the previous userid until the retval.addFoundSet(fs_contact); is called, in which a whole chunk of the data is missing and when ws_read is called in data_base.js, the ids parameter only includes the contact_id of the corresponding userid. When yboomATservoy.com is used, the ids parameter includes a full array of pks of the table.

What exactly determines this behaviour ? In User and group security I see an entry with Uid 39 which corresponds with the pk of the yboom record, but changing that user (or deleting it) doesn't make a difference.

If possible I would also I like to see an example of the most basic mobile service implementation possible that I can use on a simple mobile app that just uses the list form to list the customer name column of a test table, consisting of just the primary key and a customer name.
johann.agcanas
 
Posts: 5
Joined: Thu Sep 26, 2013 2:40 am

Re: Understanding authentication

Postby johann.agcanas » Thu Oct 10, 2013 1:50 am

I figured it out with the user id. I had a poke at the import hook and noticed the SQL query setting accountmanager_id of each companies record to 39, which determines what a user can see.

Now my new question is, can we get rid of this behaviour completely ?
johann.agcanas
 
Posts: 5
Joined: Thu Sep 26, 2013 2:40 am


Return to Servoy Mobile

Who is online

Users browsing this forum: No registered users and 1 guest

cron