GitHubDashboard/Dashboard.cs
/// <summary>
/// Once the user authorizes the application, we get a "code" back from GitHub
/// We use that code to obtain the access token.
/// </summary>
Once the user authorizes the application, we get a "code" back from GitHub
We use that code to obtain the access token.
Once the user authorizes the application we get a " code " back from GitHub We use that code to obtain the access token .
protected void OnNavigated(object sender, WebBrowserNavigatedEventArgs e)
		{
			if (e.Url.Query.Contains("?code"))
			{
				authCode = e.Url.Query.RightOf("=");
				WebClient wc = new WebClient();
				accessToken = wc.DownloadString("https://github.com/login/oauth/access_token?client_id=" + clientId + "&client_secret=" + secretId + "&code=" + authCode + "&accept=json").Between("=", "&");
				auth.Close();
				File.WriteAllLines("authorization.txt", new string[] { clientId, secretId, accessToken });
				StartQueryThread();
			}
		}
protected void OnNavigated ( object sender , WebBrowserNavigatedEventArgs e ) { if ( e . Url . Query . Contains ( " " ) ) { authCode = e . Url . Query . RightOf ( " " ) ; WebClient wc = new WebClient ( ) ; accessToken = wc . DownloadString ( " " + clientId + " " + secretId + " " + authCode + " " ) . Between ( " " , " " ) ; auth . Close ( ) ; File . WriteAllLines ( " " , new string [ ] { clientId , secretId , accessToken } ) ; StartQueryThread ( ) ; } }
Once the user authorizes the application, we get a "code" back from GitHub
We use that code to obtain the access token.
Once the user authorizes the application we get a " code " back from GitHub We use that code to obtain the access token .
sender
object
e
WebBrowserNavigatedEventArgs