Powerful Mobile Apps with Mobile Services and ASP.NET Web API
Download
Report
Transcript Powerful Mobile Apps with Mobile Services and ASP.NET Web API
Based on WebAPI
Website
XDRIVE\site\wwwroot
git
Mobile Services
compatible WebAPI
controllers
Commit hook:
Build project
source
Web.config
load
C:\...\MobileServices
Mobile Services
runtime
WebDeploy
Web.config
website root
Mobile Services
compatible WebAPI
controllers
App settings
injected here
User database:
EF code-first migrations
or custom migrations
SQL Database
TableController
BYOD
DTO
DataManager
DTO
Device
Table Storage
Mobile Service
MongoDB
TableController
Existing
Tables
DTO
DataManager
DTO
Device
Model
Mobile Service
SQL Azure/BYOD
AutoMapper
System
Properties
Table
SQL Database
Conflict resolution
TableController
(with optimistic
concurrency)
SQLite
Explicit Push/Pull
BYOD
Table Storage
Device
Mobile Service
MongoDB
Extend line-of-business to mobile
Bring turn-key login experience with
corporate credentials to mobile
developers
Enable applications built around
organizational structures
Make AAD users a first-class concept in
Mobile Services, with push-to-user and
per-user data
1)
1
2)
2
3
3)
string authority = "https://login.windows.net/<your-tenant-name>.onmicrosoft.com";
string resourceURI = "https://service-name.azure-mobile.net/login/aad";
string clientID = "<your client app ID from Azure Active Directory portal>";
AuthenticationContext
AuthenticationResult
new AuthenticationContext
await
string
// Give the access token to the mobile service
JObject
MobileServiceUser
JObject
await
MobileServiceAuthenticationProvider
1)
1
2)
2
3
3)
ServiceUser
ServiceUser
this
AzureActiveDirectoryCredentials
await
AzureActiveDirectoryCredentials
string
string
"https://login.windows.net/tenant-name.onmicrosoft.com";
string
string
"http://myresource";
b69ee3c9-c40d-4f2a-ac80-961cd1534e40“
string
AuthenticationContext
AuthenticationResult
string
// mobile service
// mobile service
new AuthenticationContext
new
new
1)
iOS, Windows, Google apps
2)
PNS
Mobile
Service
3)
Notification
Hubs
http://www.windowsazure.com/mobile