Changes to getIdentities()
Azure Mobile Services offers some great features for authenticating users of your application. After a user has logged in, calls to your tables and APIs are passed a user object which can be leveraged by your server scripts. Today we would like to announce some changes that we are making to this object. We have updated our documentation to deprecate the existing version of the getIdentities() function and replace it with an asynchronous version. The new signature now takes an options object containing success and error callbacks.
The existing version will remain operational for a while, but we highly encourage all users to switch to the asynchronous signature as soon as possible.
Previously, getIdentities() was accessed as follows:
exports.get = function (request, response) {
var identities = request.user.getIdentities();
// Do something with identities, send response
}
But with the change, you will now call getIdentities() in this way:
exports.get = function (request, response) {
request.user.getIdentities({
success: function (identities) {
// Do something with identities, send response
},
error: function (err) {
// handle errors
}
});
}
Our reason for making this change is that it is required for future Mobile Services functionality. If interested, you can preview an enhanced users feature which makes use of this function right now. See this blog post to learn about the improvements and how to get started.
As always, if you run into any problems or have questions, feel free to reach out to us in the forums.