The message you indicated was written at the end of last year when there was no support for user APIs on Azure Mobile Services - the only place where you could run scripts for user calls was on the tables. For now, you should use custom APIs for this - where you can define two APIs - one for registering a user and one for logging in. On the client, when you call the login, the API will check the username / password, and then return the Zumo token (created using the script specified in this blog post), which the client can then set to the CurrentUser property of the MobileServiceClient object.
Something like the code below:
var loginInput = new JObject(); loginInput.Add("userName", "theUserName"); loginInput.Add("password", "thePassword"); var loginResult = await client.InvokeApiAsync("login", loginInput); client.CurrentUser = new MobileServiceUser((string)loginResult["user"]); client.CurrentUser.MobileServiceAuthenticationToken = (string)loginResult["token"];
And the API will look something like this:
exports.post = function(req, res) { var user = req.body.userName; var pass = req.body.password; validateUserNamePassword(user, pass, function(error, userId, token) { if (error) { res.send(401, { error: "Unauthorized" }); } else { res.send(200, { user: userId, token: token }); } }); }
source share