SlideShare a Scribd company logo
1 of 14
Mobile Services
Authentication 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 data
App.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

More Related Content

What's hot

Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...DataArt
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetShivanand Arur
 
Integrating Visual Studio Team Services with Active Directory Federation Ser...
Integrating Visual Studio Team Services with  Active Directory Federation Ser...Integrating Visual Studio Team Services with  Active Directory Federation Ser...
Integrating Visual Studio Team Services with Active Directory Federation Ser...Suman Singh
 
OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)Emad Alashi
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Kris Wagner
 
Web Service Connection - using Login Operation
Web Service Connection - using Login OperationWeb Service Connection - using Login Operation
Web Service Connection - using Login OperationDatagaps Inc
 
Azure AD Presentation - @ BITPro - Ajay
Azure AD Presentation - @ BITPro - AjayAzure AD Presentation - @ BITPro - Ajay
Azure AD Presentation - @ BITPro - AjayAnoop Nair
 
Abap web servicepublishing-191017-1015-11758
Abap web servicepublishing-191017-1015-11758Abap web servicepublishing-191017-1015-11758
Abap web servicepublishing-191017-1015-11758asangays
 

What's hot (8)

Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
Антон Бойко (Microsoft Azure MVP, Ukrainian Azure Community Founder) «Azure M...
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.Net
 
Integrating Visual Studio Team Services with Active Directory Federation Ser...
Integrating Visual Studio Team Services with  Active Directory Federation Ser...Integrating Visual Studio Team Services with  Active Directory Federation Ser...
Integrating Visual Studio Team Services with Active Directory Federation Ser...
 
OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)OAuth in the new .NET world (OWIN)
OAuth in the new .NET world (OWIN)
 
Microsoft Azure Identity and O365
Microsoft Azure Identity and O365Microsoft Azure Identity and O365
Microsoft Azure Identity and O365
 
Web Service Connection - using Login Operation
Web Service Connection - using Login OperationWeb Service Connection - using Login Operation
Web Service Connection - using Login Operation
 
Azure AD Presentation - @ BITPro - Ajay
Azure AD Presentation - @ BITPro - AjayAzure AD Presentation - @ BITPro - Ajay
Azure AD Presentation - @ BITPro - Ajay
 
Abap web servicepublishing-191017-1015-11758
Abap web servicepublishing-191017-1015-11758Abap web servicepublishing-191017-1015-11758
Abap web servicepublishing-191017-1015-11758
 

Similar to Mobile services on windows azure (part3)

Mobile services on windows azure (part2)
Mobile services on windows azure (part2)Mobile services on windows azure (part2)
Mobile services on windows azure (part2)Radu Vunvulea
 
Codemotion Berlin-Mobile Services
Codemotion Berlin-Mobile ServicesCodemotion Berlin-Mobile Services
Codemotion Berlin-Mobile ServicesMike Benkovich
 
Terence Barr - beyond smartphones - 24mai2011
Terence Barr  - beyond smartphones - 24mai2011Terence Barr  - beyond smartphones - 24mai2011
Terence Barr - beyond smartphones - 24mai2011Agora Group
 
Windows Azure mobile services - Kolkata - 28 June 2015
Windows Azure mobile services - Kolkata - 28 June 2015Windows Azure mobile services - Kolkata - 28 June 2015
Windows Azure mobile services - Kolkata - 28 June 2015Kunal Chowdhury
 
2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile ServicesMarco Parenzan
 
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB StitchMongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB StitchMongoDB
 
Implementing open authentication_in_your_app
Implementing open authentication_in_your_appImplementing open authentication_in_your_app
Implementing open authentication_in_your_appNuhil Mehdy
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTMobiliya
 
Complex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSComplex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSBoyan Dimitrov
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchMongoDB
 
Windows Azure Mobile Services - The Perfect Partner
Windows Azure Mobile Services - The Perfect PartnerWindows Azure Mobile Services - The Perfect Partner
Windows Azure Mobile Services - The Perfect PartnerMichael Collier
 
Intro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID ConnectIntro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID ConnectLiamWadman
 
Simplify user application authentication using Microsoft Identity Platform
Simplify user application authentication using  Microsoft Identity PlatformSimplify user application authentication using  Microsoft Identity Platform
Simplify user application authentication using Microsoft Identity PlatformManoj Mittal
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTGaurav Roy
 
Community call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformCommunity call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformMicrosoft 365 Developer
 
Mobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patternsMobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patternsPieter Ennes
 
Introduction to Azure AD and Azure AD B2C
Introduction to Azure AD and Azure AD B2CIntroduction to Azure AD and Azure AD B2C
Introduction to Azure AD and Azure AD B2CJoonas Westlin
 
Integrating OAuth and Social Login Into Wordpress
Integrating OAuth and Social Login Into WordpressIntegrating OAuth and Social Login Into Wordpress
Integrating OAuth and Social Login Into WordpressWilliam Tam
 

Similar to Mobile services on windows azure (part3) (20)

Mobile services on windows azure (part2)
Mobile services on windows azure (part2)Mobile services on windows azure (part2)
Mobile services on windows azure (part2)
 
Codemotion Berlin-Mobile Services
Codemotion Berlin-Mobile ServicesCodemotion Berlin-Mobile Services
Codemotion Berlin-Mobile Services
 
Terence Barr - beyond smartphones - 24mai2011
Terence Barr  - beyond smartphones - 24mai2011Terence Barr  - beyond smartphones - 24mai2011
Terence Barr - beyond smartphones - 24mai2011
 
Windows Azure mobile services - Kolkata - 28 June 2015
Windows Azure mobile services - Kolkata - 28 June 2015Windows Azure mobile services - Kolkata - 28 June 2015
Windows Azure mobile services - Kolkata - 28 June 2015
 
2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services2015.04.23 Azure Mobile Services
2015.04.23 Azure Mobile Services
 
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB StitchMongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
 
Implementing open authentication_in_your_app
Implementing open authentication_in_your_appImplementing open authentication_in_your_app
Implementing open authentication_in_your_app
 
Building mobile apps on aws
Building mobile apps on awsBuilding mobile apps on aws
Building mobile apps on aws
 
Building mobile apps on AWS
Building mobile apps on AWSBuilding mobile apps on AWS
Building mobile apps on AWS
 
Stateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWTStateless Auth using OAUTH2 & JWT
Stateless Auth using OAUTH2 & JWT
 
Complex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWSComplex architectures for authentication and authorization on AWS
Complex architectures for authentication and authorization on AWS
 
Building Your First App with MongoDB Stitch
Building Your First App with MongoDB StitchBuilding Your First App with MongoDB Stitch
Building Your First App with MongoDB Stitch
 
Windows Azure Mobile Services - The Perfect Partner
Windows Azure Mobile Services - The Perfect PartnerWindows Azure Mobile Services - The Perfect Partner
Windows Azure Mobile Services - The Perfect Partner
 
Intro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID ConnectIntro to OAuth2 and OpenID Connect
Intro to OAuth2 and OpenID Connect
 
Simplify user application authentication using Microsoft Identity Platform
Simplify user application authentication using  Microsoft Identity PlatformSimplify user application authentication using  Microsoft Identity Platform
Simplify user application authentication using Microsoft Identity Platform
 
Stateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWTStateless Auth using OAuth2 & JWT
Stateless Auth using OAuth2 & JWT
 
Community call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformCommunity call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platform
 
Mobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patternsMobile Authentication - Onboarding, best practices & anti-patterns
Mobile Authentication - Onboarding, best practices & anti-patterns
 
Introduction to Azure AD and Azure AD B2C
Introduction to Azure AD and Azure AD B2CIntroduction to Azure AD and Azure AD B2C
Introduction to Azure AD and Azure AD B2C
 
Integrating OAuth and Social Login Into Wordpress
Integrating OAuth and Social Login Into WordpressIntegrating OAuth and Social Login Into Wordpress
Integrating OAuth and Social Login Into Wordpress
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Mobile services on windows azure (part3)

  • 1. Mobile Services Authentication and Push Notifications Radu Vunvulea vunvulear@gmail.com http://vunvulearadu.blogspot.com
  • 2. 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” } }
  • 3. Windows Azure Mobile Services • Authentication
  • 5. How to work with data • Define custom scripts that check if the given user id has rights to access his data App.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
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. 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.
  • 10. 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(); }
  • 11. 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 }
  • 12. Demo
  • 13.
  • 14. THE END Radu Vunvulea vunvulear@gmail.com http://vunvulearadu.blogspot.com

Editor's Notes

  1. COM
  2. COM
  3. COM
  4. COM
  5. COM
  6. COM
  7. COM
  8. COM
  9. COM
  10. COM