Evernote.EDAM.UserStore.UserStore.Client.authenticate C# (CSharp) Method

authenticate() public method

public authenticate ( string username, string password, string consumerKey, string consumerSecret ) : AuthenticationResult
username string
password string
consumerKey string
consumerSecret string
return AuthenticationResult
      public AuthenticationResult authenticate(string username, string password, string consumerKey, string consumerSecret)
      {
        #if !SILVERLIGHT && !NETFX_CORE
        send_authenticate(username, password, consumerKey, consumerSecret);
        return recv_authenticate();

        #else
        var asyncResult = Begin_authenticate(null, null, username, password, consumerKey, consumerSecret);
        return End_authenticate(asyncResult);

        #endif
      }
      #if SILVERLIGHT || NETFX_CORE

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Logs into Evernote with the given username and password.
        /// </summary>
        private static AuthenticationResult Authenticate( string username, string password )
        {
            try
            {
                UserStore.Client userClient = new UserStore.Client( new TBinaryProtocol( new THttpClient( new Uri( BaseUrl + "/edam/user" ) ) ) );

                if ( !userClient.checkVersion( "EvernoteSharp", Evernote.EDAM.UserStore.Constants.EDAM_VERSION_MAJOR, Evernote.EDAM.UserStore.Constants.EDAM_VERSION_MINOR ) )
                    throw new OldApiException( );

                return userClient.authenticate( username, password, ApiConsumerKey, ApiConsumerSecret );
            }
            catch ( EDAMUserException ex )
            {
                throw DecodeLoginFailure( ex );
            }
        }
All Usage Examples Of Evernote.EDAM.UserStore.UserStore.Client::authenticate