• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mobile services on windows azure (part3)

Mobile services on windows azure (part3)






Total Views
Views on SlideShare
Embed Views



24 Embeds 201

http://vunvulearadu.blogspot.ro 90
http://vunvulearadu.blogspot.com 44
http://vunvulearadu.blogspot.co.uk 15
http://vunvulearadu.blogspot.in 10
http://vunvulearadu.blogspot.ru 6
http://vunvulearadu.blogspot.de 5
http://vunvulearadu.blogspot.com.es 4
http://www.vunvulearadu.blogspot.ro 4
http://vunvulearadu.blogspot.it 2
http://vunvulearadu.blogspot.se 2
http://vunvulearadu.blogspot.ch 2
http://vunvulearadu.blogspot.hu 2
http://vunvulearadu.blogspot.dk 2
http://vunvulearadu.blogspot.fr 2
http://vunvulearadu.blogspot.com.au 2
http://vunvulearadu.blogspot.co.il 1
http://vunvulearadu.blogspot.hk 1
http://vunvulearadu.blogspot.gr 1
http://vunvulearadu.blogspot.nl 1
http://vunvulearadu.blogspot.be 1
http://vunvulearadu.blogspot.mx 1
http://vunvulearadu.blogspot.co.at 1
http://vunvulearadu.blogspot.sk 1
http://vunvulearadu.blogspot.ca 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • COM
  • COM
  • COM
  • COM
  • COM
  • COM
  • COM
  • COM
  • COM
  • COM

Mobile services on windows azure (part3) Mobile services on windows azure (part3) Presentation Transcript

  • Mobile ServicesAuthentication and Push Notifications Radu Vunvulea vunvulear@gmail.com http://vunvulearadu.blogspot.com
  • Who am I? { “name” : “Radu Vunvulea, “company” : “iQuest”, “userType” : “enthusiastic” “technologies” : [ “.NET”, “JS”, “Azure”, “Web”, “Mobile”, “SL” ], “w8experience” : [ “2 LoB App”, “1 Travel App”], “blog” : “vunvulearadu.blogspot.com”, “email” : ”vunvulear@gmail.com”, “socialMedia” : { “twitter” : “@RaduVunvulea”, “fb” : “radu.vunvulea” } }
  • Windows Azure Mobile Services• Authentication
  • Identify providers supported
  • How to work with data• Define custom scripts that check if the given user id has rights to access his dataApp.MobileService.GetTable<MyEntity>()• Before this we need to create a table with the same name• Update: table.UpdateAsync(entity)• Delete: table.DeleteAsync(entity)• Insert: table.InsertAsync(entity)• Fetch with data: • Where • Take • Skip • OrderBy • Select • ThenBy • ToListAsync
  • Register your application• Each application need to be register to the identify provider• Windows Live: • http://go.microsoft.com/fwlink/p/?LinkId=262039&clcid=0x409• Facebook • http://go.microsoft.com/fwlink/p/?LinkId=268286&clcid=0x409• Google • http://go.microsoft.com/fwlink/p/?LinkId=268303&clcid=0x409• Twitter • http://go.microsoft.com/fwlink/p/?LinkId=268300&clcid=0x409• Every identify provider require to specify the URL of our mobile service
  • Configure mobile service identity• After configuring the identity provider the “Identity” data need to be configured on our Mobile Service page• We can have more than one identify provider active• All the provider give us similar output: • Key/Id • Secret token• After setting the key and secret token your service is ready to use authentication
  • Adding authentication to data• Change table permissions of each CRUD operation that you need to be accessible by authenticate user only to “Only Authenticate Users”• After this step all the table content on the given CRUD operation will be accessible only to authenticated users• The error that is returned when a user will try to access a specific service and is not authenticated will be • 401 – Unauthorized
  • Authentication on the client• There is a build in control that resolve the authentication problem• The only think that we need to do is to specify the identify provider App.MobileService.LoginAsync( MobileServiceAuthenticationProvider.Facebook)• After this step each time when user will access a table from mobile service the user.userId field will contain the user id• Remarks: All users that are login will be able to access any kind of data from our table. In this way we didn’t restrict access to specific rows from it.
  • Restrict access to table rows• We don’t have an our of the box mechanism• On the INSERT action script we can add a column when we store the user id function insert(item, user, request) { item.userId = user.userId; request.execute(); }• On the action where we want to control access we need to check the userId function read(query, user, request) { query.where({ userId: user.userId }); request.execute(); }
  • Push notifications • Register your application • Associate your application from VS with your app from Store • Save your Client Secret key and Package Security Identifier from My Apps tab • Add Client Secret key and Package Security Identified to your Mobile Service (under Push tab) • Use “PushNotificationChannelManager” to register to push notifications • Data can be pushed even from CRUD script of Mobile Services tables: push.wns.sendToastText04(item.channel, { title: item.text }
  • Demo
  • THE END Radu Vunvulea vunvulear@gmail.com http://vunvulearadu.blogspot.com