سؤال

I'm doing my first steps with Windows Azure, starting with creating a mobile service and since I encountered two problems: - How to personalize my service in order to perform some treatments on data stored in DB before returning it to my client. -Is it possible to implement your own authentication service in order to use profiles other than provided by default (FB, twitter, google and windows live ID)

هل كانت مفيدة؟

المحلول

It's all a REST-based interface so the options are wide open! That said, do you really want to manage the identity yourself OR do you want to attach profile information to the identities that are authenticated by the various services you mention.

I'd tend to go for the latter, in which case you can collect additional data and store it in WAMS associated with the user. If you look at "Use Scripts to authorize users in Mobile Services", you'll note you have access to the 'userid' of the authentication service. That id may be opaque; however, in your 'registration' WAMS script, you'd be able to record your own meaningful data along with the ID provider's unique userid key. So now you're maintaining profile information but not having to do the authentication yourself!

Of course, within a WAMS script you can access other tables (and services) outside of the one associated with the CRUD operation that invoked it. So you could join, for instance, with your 'profile info' table in all of your other scripts using the user.userid that's passed into the script as a parameter as an index to your profile information table. This is where you can add your 'treatments' to the data.

نصائح أخرى

There are three posts that you might find helpful regarding custom identity:

Here Josh walks through how he does this in his iSO todo app: http://www.thejoyofcode.com/Exploring_custom_identity_in_Mobile_Services_Day_12_.aspx

Chris also has two helpful posts: http://chrisrisner.com/Authentication-with-Windows-Azure-Mobile-Services and http://chrisrisner.com/Authentication-with-iOS-and-Windows-Azure-Mobile-Services

You can also find a great session from TechEd 2013 about custom authentication providers and also treating some of your data either with server side script or within the DB itself.

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/WAD-B338#fbid=sB9ZMarcc7_

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top