public string Authorize() { try { _oauth = new oAuthEvernote(_service, _consumerKey, _consumerSecret, _supportLinkedAppNotebook, _windowTitle); String requestToken = _oauth.getRequestToken(); // txtOutput.Text += "\n" + "Received request token: " + requestToken; _oauth.authorizeToken(_windowTitle); // txtOutput.Text += "\n" + "Token was authorized: " + _oauth.Token + " with verifier: " + _oauth.Verifier; NameValueCollection accessInfo = _oauth.getAccessToken(); Token = accessInfo["oauth_token"]; NoteStoreUrl = accessInfo["edam_noteStoreUrl"]; UserId = accessInfo["edam_userId"]; Expires = Convert.ToInt64(accessInfo["edam_expires"]); WebApiUrlPrefix = accessInfo["edam_webApiUrlPrefix"]; LinkedAppNotebookSelected = _oauth.LinkedAppNotebookSelected; return(string.Empty); // txtOutput.Text += "\n" + "Access token was received: " + _oauth.Token; } catch (Exception exp) { // txtOutput.Text += "\nException: " + exp.Message; return(exp.Message); } }
public LoginForm(oAuthEvernote o, string windowTitle) { _oauth = o; _token = null; InitializeComponent(); this.Text = windowTitle; this.addressTextBox.Text = o.AuthorizationLink; _token = _oauth.Token; _tokenSecret = _oauth.TokenSecret; browser.Navigate(new Uri(_oauth.AuthorizationLink)); }