octokit/octokit.net — pull request #462 by Haacked (2014-04-19 23:06:41+00:00)
Title: OAuth Web Flow methods

Provide methods to make it easy for developers to implement the GitHub OAuth web flow.

https://developer.github.com/v3/oauth/#web-application-flow

Example of usage.

### When not authenticated

Redirect to GitHub.com. This allows the user to accepts the scopes.

```csharp
// 1. Redirect users to request GitHub access
var request = new OauthLoginRequest("8b89b15af4ae1d408108") {Scopes = {"user", "notifications"}};
var oauthLoginUrl = client.Oauth.GetGitHubLoginUrl(request);
Response.Redirect(oauthLoginUrl.ToString());
```

### Server to server request to get the auth token.

```csharp
var token = await client.Oauth.CreateAccessToken(
new OauthTokenRequest(clientId, clientSecret, code)
{
RedirectUri = new Uri("http://localhost:58292/")
});
```