{"id":201668,"date":"2013-11-11T21:22:04","date_gmt":"2013-11-11T17:22:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=201668"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=201668","title":{"rendered":"<span class=\"post_title\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e Windows Azure Mobile Services \u0432 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u043c WPF \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ed3\/7d0\/140\/ed37d01400fc02b836481145c95b1ea5.png\" align=\"right\"\/><\/p>\n<p>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435!<\/p>\n<p>  \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Windows Azure Mobile Services \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u043b\u0443\u0436\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f Google, Facebook, Twitter \u0438 \u0441\u0430\u043c Microsoft Account. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u043d\u0438\u0445 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>  \u0421\u0440\u0435\u0434\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0447\u0438\u0441\u043b\u0438\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043a\u0440\u043e\u043c\u0435\u2026 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 Windows Desktop. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041e \u0447\u0451\u043c \u0440\u0435\u0447\u044c<\/h4>\n<p>  \u0412 <a href=\"http:\/\/www.windowsazure.com\/en-us\/develop\/mobile\/tutorials\/get-started-with-users-dotnet\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0432 \u043d\u0451\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0437\u0430\u0432\u044f\u0437\u0430\u043d \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 Windows.UI.Popups. \u041d\u0435\u0443\u0436\u0435\u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u043c\u0435\u043b\u043e\u0447\u044c \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0430\u0441 \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0449\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0432\u0441\u0435 \u0435\u0449\u0451 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u0443\u0435\u0442? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f:<\/p>\n<ul>\n<li>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f Web-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 <\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 user id \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 authentication token \u043e\u0442 Azure \u2014 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0431\u0430\u043a\u0435\u043d\u0434\u0443.<\/li>\n<li>\u0412\u043e\u0437\u0432\u0440\u0430\u0442 User ID \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 MobileServiceUser, \u0430 authentication token \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 MobileServiceClient.<\/li>\n<\/ul>\n<p>  \u041b\u0438\u0447\u043d\u043e \u044f \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u043a\u043e\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432 \u0435\u0434\u0438\u043d\u043e\u043c \u043e\u043a\u043d\u0435, \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0434\u0443\u043c\u043a\u0438<\/h4>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b <a href=\"https:\/\/account.live.com\/developers\/applications\/index\">\u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/a> \u0412\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443 \u0441\u0435\u0431\u044f \u0432 Microsoft Account \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430, \u0438\u043c\u0435\u043d\u043d\u043e Microsoft-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>  \u0412 \u0432\u0451\u0440\u0441\u0442\u043a\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f:  <\/p>\n<ol>\n<li>WPF \u043e\u043a\u043e\u0448\u043a\u043e \u0441 Frame, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/li>\n<li>\u041f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 \u00abLoginPage\u00bb c \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u00abLogin\u00bb.<\/li>\n<li>\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f WebBrowser \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u2014 \u00abWebLoginPage\u00bb.<\/li>\n<\/ol>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434-\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 MobileServiceClient:<\/p>\n<pre><code class=\"cs\">public static class DesktopWebLoginExtension     {     public async Task&lt;MobileServiceUser&gt; LoginAsync(this MobileServiceClient client, MobileServiceAuthenticationProvider provider, LoginPape loginPage)         {             Uri startUri = new Uri(client.ApplicationUri, &quot;login\/&quot; + provider.ToString().ToLowerInvariant());             Uri endUri = new Uri(client.ApplicationUri, &quot;login\/done&quot;);                          LoginResult externalAuthProviderLoginResult = await loginPage.GetLoginResultAsync(startUri, endUri);                          if (externalAuthProviderLoginResult == null)              {                 return null;             }              var returnServiceUser = new MobileServiceUser(externalAuthProviderLoginResult.UserId);             returnServiceUser.MobileServiceAuthenticationToken = externalAuthProviderLoginResult.AuthenticationToken;             client.CurrentUser = returnServiceUser;             return returnServiceUser;               }     } <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c:  <\/p>\n<ol>\n<li>\u041a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 loginPage \u2014 \u0447\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u0440\u0443\u0431\u044b\u043c \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435\u043c software layer, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u043e\u0439\u0434\u0435\u0442.<\/li>\n<li>startUri \u0438 endUri \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windowsazure\/dn283952.aspx\">\u044d\u0442\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/li>\n<li>loginPage.GetLoginResultAsync \u2014 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0451\u0442 \u043d\u0430\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 LoginResult<\/li>\n<li>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043d\u0430\u043c \u043f\u043e\u043b\u0435\u0439 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/li>\n<\/ol>\n<p>  \u0410 \u0432\u043e\u0442 \u0438 \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u0438\u0437 JSON-\u043e\u0442\u0432\u0435\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public class LoginResult     {         public string UserId { get; set; }         public string AuthenticationToken { get; set; }     }  <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b WebLoginPage \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public class WebLoginPage : Page     {          private Uri startUri;         private Uri endUri;          public delegate void LoginCompleteEventHandler(LoginResult result);         public event LoginCompleteEventHandler UserLogedIn;          public LoginBrowserPage()         {             InitializeComponent();             webBrowser.Navigating += webBrowser_Navigating;         }      public Task&lt;LoginResult&gt; GetLoginResultAsync(Uri startUri, Uri endUri)         {             this.startUri = startUri;             this.endUri = endUri;              var returnTask = new TaskCompletionSource&lt;LoginResult&gt;();              webBrowser.Navigate(startUri);              this.UserLogedIn += (r) =&gt; { returnTask.SetResult(r); };              return returnTask.Task;         }      internal void webBrowser_Navigating(object sender, NavigatingCancelEventArgs e)         {             if (e.Uri.Equals(this.endUri))             {                 string uri = e.Uri.ToString();                  if (uri.LastIndexOf(&quot;#token=&quot;) != 0)                 {                     var startOfToken = uri.IndexOf(&quot;#token=&quot;) + &quot;#token=&quot;.Length;                     uri = uri.Substring(startOfToken).Replace(&quot;%2C&quot;, &quot;,&quot;);                     JObject jsonObj = JObject.Parse(uri);                     var userId = jsonObj[&quot;user&quot;][&quot;userId&quot;].ToObject&lt;string&gt;();                     var authToken = jsonObj[&quot;authenticationToken&quot;].ToObject&lt;string&gt;();                      UserLogedIn(new LoginResult() { UserId = userId, AuthenticationToken = authToken });                 }                 else                 {                     UserLogedIn(null);                 }             }         }     } <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c:  <\/p>\n<ol>\n<li>\u041c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u0438\u043d\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/li>\n<li>GetLoginResultAsync \u2014 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u00ab\u0436\u0434\u0451\u0442\u00bb \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 TaskCompletionSource. \u0422\u0430\u043a \u043c\u044b \u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u0435\u0434\u0438\u043d\u043e\u0439 \u00ab\u043b\u0438\u043d\u0438\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u00bb \u0438\u0437 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0421 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0442\u044f\u0436\u043a\u043e\u0439 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u043e \u0444\u0440\u0435\u0439\u043c \u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e (\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e) \u2014 \u043a\u0430\u043a \u0438 \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442 \u043d\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c Microsoft \u0441 \u043f\u0440\u0438\u0445\u043e\u0434\u043e\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/li>\n<li>webBrowser_Navigating \u2014 \u0432 \u044d\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u044b \u0441\u0442\u0430\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u043c JSON-\u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u0430\u0432\u0435\u0442\u043d\u044b\u0435 UserId \u0438 AuthenticationToken.<\/li>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0435\u0442\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u2014 \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u0441\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/li>\n<\/ol>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0430\u043c \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<pre><code class=\"cs\">var user = await MobileServiceClient.LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount, webLoginPage); <\/code><\/pre>\n<p>  P.S. \u041f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043d\u0430\u0448 webBrowser \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u043d\u0430\u043c \u0441\u043a\u0430\u0447\u0430\u0442\u044c JSON \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u042d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 IE \u0434\u0432\u0438\u0436\u043a\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043a\u043b\u044e\u0447\u0438\u043a\u043e\u043c \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435:<\/p>\n<blockquote><p>Windows Registry Editor Version 5.00;<br \/>  [HKEY_CLASSES_ROOT\\MIME\\Database\\Content Type\\application\/json]<br \/>  \u00abCLSID\u00bb=&quot;{25336920-03F9-11cf-8FD0-00AA00686F13}&quot;<br \/>  \u00abEncoding\u00bb=hex:08,00,00,00  <\/p><\/blockquote>\n<p>  <\/p>\n<h4>\u0412\u044b\u0432\u043e\u0434<\/h4>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0448\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043c\u044b \u0441\u043d\u044f\u043b\u0438 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c MobileService.LoginAsync \u0432 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<h5>\u0421\u0441\u044b\u043b\u043a\u0438:<\/h5>\n<p>  <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windowsazure\/jj710108.aspx\">Windows Azure Mobile Services REST API Reference<\/a><br \/>  <a href=\"http:\/\/www.windowsazure.com\/en-us\/develop\/mobile\/tutorials\/get-started-with-users-dotnet\/\">Get started with authentication in Mobile Services<\/a><br \/>  <a href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?linkid=268303&amp;clcid=0x409\">Register your application in Google<\/a> \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/201668\/\"> http:\/\/habrahabr.ru\/post\/201668\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ed3\/7d0\/140\/ed37d01400fc02b836481145c95b1ea5.png\" align=\"right\"\/><\/p>\n<p>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435!<\/p>\n<p>  \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 Windows Azure Mobile Services \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u043b\u0443\u0436\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f Google, Facebook, Twitter \u0438 \u0441\u0430\u043c Microsoft Account. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u043d\u0438\u0445 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>  \u0421\u0440\u0435\u0434\u0438 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0447\u0438\u0441\u043b\u0438\u0442\u0441\u044f \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043a\u0440\u043e\u043c\u0435\u2026 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 Windows Desktop.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-201668","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=201668"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/201668\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=201668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=201668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=201668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}