SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

Антон Бойко (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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Último (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
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
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

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

Notas do Editor

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