An AuthenticationBroker for the Windows Phone Platform that is like the Windows Store WebAuthenticationBroker APIs.
상속: IDisposable
예제 #1
0
        /// <summary>
        /// Finishes the login process initiated by the LoginAsync() call, should be called from the App OnActivated event
        /// when it is triggered due to the Web Authentication Broker
        /// </summary>
        /// <param name="client">
        /// The client.
        /// </param>
        /// <param name="result">
        /// Result from the Web Authentication Broker
        /// </param>
        /// <returns>
        /// Logged in mobile user
        /// </returns>
        public static void LoginComplete(this IMobileServiceClient client, WebAuthenticationBrokerContinuationEventArgs result)
        {
            AuthenticationBroker authBroker = new AuthenticationBroker();

            authBroker.AuthenticationComplete(result.WebAuthenticationResult);
        }
        /// <summary>
        /// Finishes the login process initiated by the LoginAsync() call, should be called from the App OnActivated event
        /// when it is triggered due to the Web Authentication Broker
        /// </summary>
        /// <param name="client">
        /// The client.
        /// </param> 
        /// <param name="result">
        /// Result from the Web Authentication Broker 
        /// </param>
        /// <returns>
        /// Logged in mobile user
        /// </returns>
        public static void LoginComplete(this IMobileServiceClient client, WebAuthenticationBrokerContinuationEventArgs result)
        {
            AuthenticationBroker authBroker = new AuthenticationBroker();

            authBroker.AuthenticationComplete(result.WebAuthenticationResult);
        }
        /// <summary>
        /// Provides Login logic by showing a login UI.
        /// </summary>
        /// <returns>
        /// Task that will complete with the response string when the user has finished authentication.
        /// </returns>
        protected override Task<string> LoginAsyncOverride()
        {
            AuthenticationBroker broker = new AuthenticationBroker();

            return broker.AuthenticateAsync(this.StartUri, this.EndUri, false);
        }
        /// <summary>
        /// Provides Login logic by showing a UI and using single sign-on.
        /// </summary>
        /// <returns>
        /// Task that will complete with the response string when the user has finished authentication.
        /// </returns>
        protected override Task <string> LoginAsyncOverride()
        {
            AuthenticationBroker broker = new AuthenticationBroker();

            return(broker.AuthenticateAsync(this.StartUri, this.EndUri, true));
        }