mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 03:16:11 +00:00
d7a69e20d7
Provide methods to make it easy for developers to implement the web flow. https://developer.github.com/v3/oauth/#web-application-flow
33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
using System;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace Octokit
|
||
{
|
||
/// <summary>
|
||
/// Provides methods used in the OAuth web flow.
|
||
/// </summary>
|
||
public interface IOauthClient
|
||
{
|
||
/// <summary>
|
||
/// Gets the URL used in the first step of the web flow. The Web application should redirect to this URL.
|
||
/// </summary>
|
||
/// <param name="request">Parameters to the Oauth web flow login url</param>
|
||
/// <returns></returns>
|
||
Uri GetGitHubLoginUrl(OauthLoginRequest request);
|
||
|
||
/// <summary>
|
||
/// Makes a request to get an access token using the code returned when GitHub.com redirects back from the URL
|
||
/// <see cref="GetGitHubLoginUrl">GitHub login url</see> to the application.
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// If the user accepts your request, GitHub redirects back to your site with a temporary code in a code
|
||
/// parameter as well as the state you provided in the previous step in a state parameter. If the states don’t
|
||
/// match, the request has been created by a third party and the process should be aborted. Exchange this for
|
||
/// an access token using this method.
|
||
/// </remarks>
|
||
/// <param name="request"></param>
|
||
/// <returns></returns>
|
||
Task<OauthToken> CreateAccessToken(OauthTokenRequest request);
|
||
}
|
||
}
|