C# 클래스 PinSharp.PinterestAuthClient

파일 보기 프로젝트 열기: Krusen/PinSharp

공개 메소드들

메소드 설명
BuildAuthorizationUrl ( string clientId, string redirectUri, Scopes scopes ) : string

Generates a login URL with the required parameters. Users will need to visit this URL to authorize your app to use the API on their behalf.

If they accept they will be redirected to the redirectUri with two query string parameters - "state" and "code".

Call BuildAuthorizationUrl if you want to specify the state value yourself to be able to prevent spoofing.

"code" is used with GetAccessTokenAsync to get an access token to use with PinterestClient.

BuildAuthorizationUrl ( string clientId, string redirectUri, Scopes scopes, string state ) : string

Generates a login URL with the required parameters. Users will need to visit this URL to authorize your app to use the API on their behalf.

If they accept they will be redirected to the redirectUri with two query string parameters - "state" and "code".

"state" verifies that this comes from you. "code" is used with GetAccessTokenAsync to get an access token to use with PinterestClient.

CreateRandomState ( int length = 10 ) : string

Generates a random string that you can use to verify that the redirect back to your site or app wasn't spoofed.

Pass this to BuildAuthorizationUrl to get the correct login URL.

GetAccessTokenAsync ( string clientId, string clientSecret, string code, string apiVersion = "v1" ) : Task

Gets an access token which you can then use with PinterestClient.

비공개 메소드들

메소드 설명
GetScope ( Scopes scopes ) : string

메소드 상세

BuildAuthorizationUrl() 공개 정적인 메소드

Generates a login URL with the required parameters. Users will need to visit this URL to authorize your app to use the API on their behalf.

If they accept they will be redirected to the redirectUri with two query string parameters - "state" and "code".

Call BuildAuthorizationUrl if you want to specify the state value yourself to be able to prevent spoofing.

"code" is used with GetAccessTokenAsync to get an access token to use with PinterestClient.

public static BuildAuthorizationUrl ( string clientId, string redirectUri, Scopes scopes ) : string
clientId string The Client ID (also known as App ID) of your app. See https://developers.pinterest.com/apps/
redirectUri string /// The URL you want your user to be redirected to after authorizing your app. /// The code needed for will be added as query string parameter "code". ///
scopes Scopes The scopes you want to request from the user.
리턴 string

BuildAuthorizationUrl() 공개 정적인 메소드

Generates a login URL with the required parameters. Users will need to visit this URL to authorize your app to use the API on their behalf.

If they accept they will be redirected to the redirectUri with two query string parameters - "state" and "code".

"state" verifies that this comes from you. "code" is used with GetAccessTokenAsync to get an access token to use with PinterestClient.

public static BuildAuthorizationUrl ( string clientId, string redirectUri, Scopes scopes, string state ) : string
clientId string The Client ID (also known as App ID) of your app. See https://developers.pinterest.com/apps/
redirectUri string /// The URL you want your user to be redirected to after authorizing your app. /// The code needed for will be added as query string parameter "code". ///
scopes Scopes The scopes you want to request from the user.
state string A string that is added to as query string parameter "state". This is to prevent spoofing.
리턴 string

CreateRandomState() 공개 정적인 메소드

Generates a random string that you can use to verify that the redirect back to your site or app wasn't spoofed.

Pass this to BuildAuthorizationUrl to get the correct login URL.

public static CreateRandomState ( int length = 10 ) : string
length int The length of the random string.
리턴 string

GetAccessTokenAsync() 공개 정적인 메소드

Gets an access token which you can then use with PinterestClient.
public static GetAccessTokenAsync ( string clientId, string clientSecret, string code, string apiVersion = "v1" ) : Task
clientId string The Client ID (also known as App ID) of your app. See https://developers.pinterest.com/apps/
clientSecret string The Client secret (also known as App secret) of your app. See https://developers.pinterest.com/apps/
code string The code that was passed to your redirectUri as a query string parameter.
apiVersion string The API version. Defaults to "v1" if left out.
리턴 Task