private static string GetAuthCode(string account, Uri authenticationUri, Uri redirectUri) { string authCode = null; var browser = new BrowserWindow(); browser.Authenticated += (s, e) => { authCode = e.Parameters.Get("code"); browser.Close(); }; browser.Show(account, authenticationUri, redirectUri); return authCode; }
private static Tuple<string, string> GetAuthCode(string account, Uri authenticationUri, Uri redirectUri) { string oauth_token = null, oauth_verifier = null; var browser = new BrowserWindow(); browser.Authenticated += (s, e) => { oauth_token = e.Parameters["oauth_token"]; oauth_verifier = e.Parameters["oauth_verifier"]; browser.Close(); }; browser.Show(account, authenticationUri, redirectUri); return new Tuple<string, string>(oauth_token, oauth_verifier); }