C# 클래스 RestSharp.Authenticators.OAuth.OAuthTools

파일 보기 프로젝트 열기: nicwise/RestSharp 1 사용 예제들

공개 메소드들

메소드 설명
ConcatenateRequestElements ( string method, string url, WebParameterCollection parameters ) : string

Creates a request elements concatentation value to send with a request. This is also known as the signature base.

ConstructRequestUrl ( Uri url ) : string

Creates a request URL suitable for making OAuth requests. Resulting URLs must exclude port 80 or port 443 when accompanied by HTTP and HTTPS, respectively. Resulting URLs must be lower case.

GetNonce ( ) : string

Generates a random 16-byte lowercase alphanumeric string.

GetSignature ( OAuthSignatureMethod signatureMethod, OAuthSignatureTreatment signatureTreatment, string signatureBase, string consumerSecret ) : string

Creates a signature value given a signature base and the consumer secret. This method is used when the token secret is currently unknown.

GetSignature ( OAuthSignatureMethod signatureMethod, OAuthSignatureTreatment signatureTreatment, string signatureBase, string consumerSecret, string tokenSecret ) : string

Creates a signature value given a signature base and the consumer secret and a known token secret.

GetSignature ( OAuthSignatureMethod signatureMethod, string signatureBase, string consumerSecret ) : string

Creates a signature value given a signature base and the consumer secret. This method is used when the token secret is currently unknown.

GetSignature ( OAuthSignatureMethod signatureMethod, string signatureBase, string consumerSecret, string tokenSecret ) : string

Creates a signature value given a signature base and the consumer secret and a known token secret.

GetTimestamp ( ) : string

Generates a timestamp based on the current elapsed seconds since '01/01/1970 0000 GMT"

GetTimestamp ( System.DateTime dateTime ) : string

Generates a timestamp based on the elapsed seconds of a given time since '01/01/1970 0000 GMT"

NormalizeRequestParameters ( WebParameterCollection parameters ) : string

Sorts a collection of key-value pairs by name, and then value if equal, concatenating them into a single string. This string should be encoded prior to, or after normalization is run.

SortParametersExcludingSignature ( WebParameterCollection parameters ) : WebParameterCollection

Sorts a WebParameterCollection by name, and then value if equal.

UrlEncodeRelaxed ( string value ) : string

URL encodes a string based on section 5.1 of the OAuth spec. Namely, percent encoding with [RFC3986], avoiding unreserved characters, upper-casing hexadecimal characters, and UTF-8 encoding for text value pairs.

The Uri.EscapeDataString method is supposed to take on RFC 3986 behavior if certain elements are present in a .config file. Even if this actually worked (which in my experiments it doesn't), we can't rely on every host actually having this configuration element present.

UrlEncodeStrict ( string value ) : string

URL encodes a string based on section 5.1 of the OAuth spec. Namely, percent encoding with [RFC3986], avoiding unreserved characters, upper-casing hexadecimal characters, and UTF-8 encoding for text value pairs.

비공개 메소드들

메소드 설명
OAuthTools ( ) : System

메소드 상세

ConcatenateRequestElements() 공개 정적인 메소드

Creates a request elements concatentation value to send with a request. This is also known as the signature base.
public static ConcatenateRequestElements ( string method, string url, WebParameterCollection parameters ) : string
method string The request's HTTP method type
url string The request URL
parameters WebParameterCollection The request's parameters
리턴 string

ConstructRequestUrl() 공개 정적인 메소드

Creates a request URL suitable for making OAuth requests. Resulting URLs must exclude port 80 or port 443 when accompanied by HTTP and HTTPS, respectively. Resulting URLs must be lower case.
public static ConstructRequestUrl ( Uri url ) : string
url System.Uri The original request URL
리턴 string

GetNonce() 공개 정적인 메소드

Generates a random 16-byte lowercase alphanumeric string.
public static GetNonce ( ) : string
리턴 string

GetSignature() 공개 정적인 메소드

Creates a signature value given a signature base and the consumer secret. This method is used when the token secret is currently unknown.
public static GetSignature ( OAuthSignatureMethod signatureMethod, OAuthSignatureTreatment signatureTreatment, string signatureBase, string consumerSecret ) : string
signatureMethod OAuthSignatureMethod The hashing method
signatureTreatment OAuthSignatureTreatment The treatment to use on a signature value
signatureBase string The signature base
consumerSecret string The consumer key
리턴 string

GetSignature() 공개 정적인 메소드

Creates a signature value given a signature base and the consumer secret and a known token secret.
public static GetSignature ( OAuthSignatureMethod signatureMethod, OAuthSignatureTreatment signatureTreatment, string signatureBase, string consumerSecret, string tokenSecret ) : string
signatureMethod OAuthSignatureMethod The hashing method
signatureTreatment OAuthSignatureTreatment The treatment to use on a signature value
signatureBase string The signature base
consumerSecret string The consumer secret
tokenSecret string The token secret
리턴 string

GetSignature() 공개 정적인 메소드

Creates a signature value given a signature base and the consumer secret. This method is used when the token secret is currently unknown.
public static GetSignature ( OAuthSignatureMethod signatureMethod, string signatureBase, string consumerSecret ) : string
signatureMethod OAuthSignatureMethod The hashing method
signatureBase string The signature base
consumerSecret string The consumer key
리턴 string

GetSignature() 공개 정적인 메소드

Creates a signature value given a signature base and the consumer secret and a known token secret.
public static GetSignature ( OAuthSignatureMethod signatureMethod, string signatureBase, string consumerSecret, string tokenSecret ) : string
signatureMethod OAuthSignatureMethod The hashing method
signatureBase string The signature base
consumerSecret string The consumer secret
tokenSecret string The token secret
리턴 string

GetTimestamp() 공개 정적인 메소드

Generates a timestamp based on the current elapsed seconds since '01/01/1970 0000 GMT"
public static GetTimestamp ( ) : string
리턴 string

GetTimestamp() 공개 정적인 메소드

Generates a timestamp based on the elapsed seconds of a given time since '01/01/1970 0000 GMT"
public static GetTimestamp ( System.DateTime dateTime ) : string
dateTime System.DateTime A specified point in time.
리턴 string

NormalizeRequestParameters() 공개 정적인 메소드

Sorts a collection of key-value pairs by name, and then value if equal, concatenating them into a single string. This string should be encoded prior to, or after normalization is run.
public static NormalizeRequestParameters ( WebParameterCollection parameters ) : string
parameters WebParameterCollection
리턴 string

SortParametersExcludingSignature() 공개 정적인 메소드

Sorts a WebParameterCollection by name, and then value if equal.
public static SortParametersExcludingSignature ( WebParameterCollection parameters ) : WebParameterCollection
parameters WebParameterCollection A collection of parameters to sort
리턴 WebParameterCollection

UrlEncodeRelaxed() 공개 정적인 메소드

URL encodes a string based on section 5.1 of the OAuth spec. Namely, percent encoding with [RFC3986], avoiding unreserved characters, upper-casing hexadecimal characters, and UTF-8 encoding for text value pairs.
The Uri.EscapeDataString method is supposed to take on RFC 3986 behavior if certain elements are present in a .config file. Even if this actually worked (which in my experiments it doesn't), we can't rely on every host actually having this configuration element present.
public static UrlEncodeRelaxed ( string value ) : string
value string The value to escape.
리턴 string

UrlEncodeStrict() 공개 정적인 메소드

URL encodes a string based on section 5.1 of the OAuth spec. Namely, percent encoding with [RFC3986], avoiding unreserved characters, upper-casing hexadecimal characters, and UTF-8 encoding for text value pairs.
public static UrlEncodeStrict ( string value ) : string
value string
리턴 string