C# 클래스 ImgurNet.Authentication.OAuth2Authentication

상속: IAuthentication
파일 보기 프로젝트 열기: 0xdeafcafe/ImgurNet 1 사용 예제들

공개 메소드들

메소드 설명
AuthorizeWithCode ( string code ) : System.Threading.Tasks.Task

Gets the token set from the code in the query string of the callback url. Throws a if the code is not valid.

AuthorizeWithPin ( string pin ) : System.Threading.Tasks.Task

Gets the token set from the pin the user has inputted. Throws a if the pin is not valid.

AuthorizeWithToken ( string accessToken, string refreshToken, int expiresIn, string authorizedUsername ) : void

Authorizes with the tokens that you recieved from the url in CreateAuthorizationUrl

CreateAuthorizationUrl ( OAuth2Type responseType, string state = null ) : string

Creates the Authorization Url, that the user will visit to allow your application to access their user account. For more information on how OAuth2 on Imgur works, visit their Developer Section (https://api.imgur.com/oauth2)

OAuth2Authentication ( string clientId, string clientSecret, bool checkRateLimit ) : System

Creates a new Imgur Authorization based off of a client's ClientId.

RefreshTokens ( ) : System.Threading.Tasks.Task

Gets a new AccessToken and RefreshToken

비공개 메소드들

메소드 설명
GrantTypeFromOAuthType ( OAuth2Type oAuth2Type ) : string

Generates a grant_type from the OAuth2 Type used in this authentication

메소드 상세

AuthorizeWithCode() 공개 메소드

Gets the token set from the code in the query string of the callback url. Throws a if the code is not valid.
public AuthorizeWithCode ( string code ) : System.Threading.Tasks.Task
code string The code from the callback Url.
리턴 System.Threading.Tasks.Task

AuthorizeWithPin() 공개 메소드

Gets the token set from the pin the user has inputted. Throws a if the pin is not valid.
public AuthorizeWithPin ( string pin ) : System.Threading.Tasks.Task
pin string The pin the user entered.
리턴 System.Threading.Tasks.Task

AuthorizeWithToken() 공개 메소드

Authorizes with the tokens that you recieved from the url in CreateAuthorizationUrl
public AuthorizeWithToken ( string accessToken, string refreshToken, int expiresIn, string authorizedUsername ) : void
accessToken string The you recieved.
refreshToken string The you recieved.
expiresIn int The you recieved.
authorizedUsername string The Username of the account that has been authorized.
리턴 void

CreateAuthorizationUrl() 공개 메소드

Creates the Authorization Url, that the user will visit to allow your application to access their user account. For more information on how OAuth2 on Imgur works, visit their Developer Section (https://api.imgur.com/oauth2)
public CreateAuthorizationUrl ( OAuth2Type responseType, string state = null ) : string
responseType OAuth2Type /// The type of response you want to use. It's recomended that; /// - Pin: Desktop/Server/Mobile Applications /// - Code: Desktop/Server/Mobile Applications /// - Token: Javascript Applications ///
state string The state you want to pass through auth. This will be given back to you from the re-direct url if you use Code or Token Authentication.
리턴 string

OAuth2Authentication() 공개 메소드

Creates a new Imgur Authorization based off of a client's ClientId.
public OAuth2Authentication ( string clientId, string clientSecret, bool checkRateLimit ) : System
clientId string The ClientId of your imgur client. Create one here (https://api.imgur.com/oauth2/addclient).
clientSecret string The ClientSecret of your imgur client. Create one here (https://api.imgur.com/oauth2/addclient).
checkRateLimit bool Check, and populate the current ratelimit status of your client.
리턴 System

RefreshTokens() 공개 메소드

Gets a new AccessToken and RefreshToken
public RefreshTokens ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task