Windows.Security.Authentication.OnlineId.OnlineIdAuthenticator.AuthenticateUserAsync C# (CSharp) Method

AuthenticateUserAsync() private method

private AuthenticateUserAsync ( [ request ) : UserAuthenticationOperation
request [
return UserAuthenticationOperation
		public extern UserAuthenticationOperation AuthenticateUserAsync([In] OnlineIdServiceTicketRequest request);
		[DefaultOverload, Overload("AuthenticateUserAsyncAdvanced")]

Same methods

OnlineIdAuthenticator::AuthenticateUserAsync ( [ requests, [ credentialPromptType ) : UserAuthenticationOperation

Usage Example

コード例 #1
0
ファイル: LiveConnection.cs プロジェクト: nghia2080/CProject
        /// <summary>
        /// Create connection with scope Basic, SkyDrive.
        /// </summary>
        /// <returns>Return true if connect successful. Otherwise, return false.</returns>
        public async Task<bool> CreateConnectionAsync()
        {
            if (AccessToken != null)
            {
                return true;
            }

            try
            {
                var targetArray = new List<OnlineIdServiceTicketRequest>
                                      {
                                          new OnlineIdServiceTicketRequest("wl.basic wl.signin wl.contacts_photos",
                                                                           "DELEGATION")
                                      };

                _authenticator = new OnlineIdAuthenticator();

                var promptType = (ApplicationData.Current.LocalSettings.Values["UserFirstName"] + string.Empty != string.Empty) ? CredentialPromptType.PromptIfNeeded : CredentialPromptType.RetypeCredentials;


                var result = await _authenticator.AuthenticateUserAsync(targetArray, promptType);

                if (result.Tickets[0].Value != string.Empty)
                {
                    AccessToken = result.Tickets[0].Value;
                    return true;
                }
                else
                {
                    // errors are to be handled here.
                    return false;
                }
                //var loginResult = await _auth.LoginAsync(new[] { "wl.basic, wl.logout" });

                //if (loginResult.Status == LiveConnectSessionStatus.Connected)
                //{
                //    _liveConnectClient = new LiveConnectClient(loginResult.Session);
                //    eSECID = ApplicationData.Current.RoamingSettings.Values[ESEC_ID] + string.Empty;

                //    return true;
                //}

                //return false;
            }
            catch
            {
                return false;
            }
        }
All Usage Examples Of Windows.Security.Authentication.OnlineId.OnlineIdAuthenticator::AuthenticateUserAsync