C# Class SimpleOAuth.OAuthRequestWrapper

Contains a WebRequest and does all the necessary work in order to sign it as a valid OAuth request before it gets sent.
Afficher le fichier Open project: cbenard/SimpleOAuth.Net

Private Properties

Свойство Type Description
OAuthRequestWrapper System
createAuthorization void
createSignature void

Méthodes publiques

Méthode Description
InHeader ( ) : void

Complete the request signing and add the OAuth information to the Authorization header.

This must be your last step in the function chain.

WithCallback ( string callbackUrl ) : OAuthRequestWrapper

Set the callback address that the OAuth Request Token stage should use.

The oauth_callback is sometimes required at the Request Token stage in a three-legged OAuth login request. It is possible to set this for other request, but may be unexpected and cause issues.

WithEncryption ( EncryptionMethod enc ) : OAuthRequestWrapper

Set the encryption method that should be used for this request.

This is equivalent to setting OAuthRequestWrapper.SigningMethod. If it is not set, the default is to use EncryptionMethod.HMACSHA1.

WithPostParameters ( string parameters ) : OAuthRequestWrapper

Provide the POST request to generate a valid OAuth signature.

The OAuth standard requires POST parameters sent in application/x-www-form-urlencoded requests to be included in the OAuth base string to create a valid signature. If it is not provided, then the request will fail. If this is set, then the WebRequest.ContentType of the OAuthRequestWrapper.ContainedRequest will be set to 'application/x-www-form-urlencoded' if it is not already set.

WithTokens ( SimpleOAuth.Tokens oauthTokens ) : OAuthRequestWrapper

Set the tokens that should be used for this request.

This is equivalent to setting OAuthRequestWrapper.RequestTokens.

WithVerifier ( string verifier ) : OAuthRequestWrapper

Set the oauth_verifier in the OAuth Access Token stage.

WithVersion ( string version ) : OAuthRequestWrapper

Set the version of OAuth being used.

This is equivalent to setting OAuthRequestWrapper.OAuthVersion. If this is not set, then "1.0" is used.

Private Methods

Méthode Description
OAuthRequestWrapper ( WebRequest toContain ) : System

There is only one constructor, and the OAuthRequestWrapper can only be instantiated internally to the library.

createAuthorization ( ) : void
createSignature ( ) : void

Method Details

InHeader() public méthode

Complete the request signing and add the OAuth information to the Authorization header.
This must be your last step in the function chain.
public InHeader ( ) : void
Résultat void

WithCallback() public méthode

Set the callback address that the OAuth Request Token stage should use.
The oauth_callback is sometimes required at the Request Token stage in a three-legged OAuth login request. It is possible to set this for other request, but may be unexpected and cause issues.
public WithCallback ( string callbackUrl ) : OAuthRequestWrapper
callbackUrl string An address or some other string to pass as the OAuth callback.
Résultat OAuthRequestWrapper

WithEncryption() public méthode

Set the encryption method that should be used for this request.
This is equivalent to setting OAuthRequestWrapper.SigningMethod. If it is not set, the default is to use EncryptionMethod.HMACSHA1.
public WithEncryption ( EncryptionMethod enc ) : OAuthRequestWrapper
enc EncryptionMethod A
Résultat OAuthRequestWrapper

WithPostParameters() public méthode

Provide the POST request to generate a valid OAuth signature.
The OAuth standard requires POST parameters sent in application/x-www-form-urlencoded requests to be included in the OAuth base string to create a valid signature. If it is not provided, then the request will fail. If this is set, then the WebRequest.ContentType of the OAuthRequestWrapper.ContainedRequest will be set to 'application/x-www-form-urlencoded' if it is not already set.
public WithPostParameters ( string parameters ) : OAuthRequestWrapper
parameters string The POST parameters that will be sent.
Résultat OAuthRequestWrapper

WithTokens() public méthode

Set the tokens that should be used for this request.
This is equivalent to setting OAuthRequestWrapper.RequestTokens.
public WithTokens ( SimpleOAuth.Tokens oauthTokens ) : OAuthRequestWrapper
oauthTokens SimpleOAuth.Tokens A object containing the Consumer and/or Access tokens.
Résultat OAuthRequestWrapper

WithVerifier() public méthode

Set the oauth_verifier in the OAuth Access Token stage.
public WithVerifier ( string verifier ) : OAuthRequestWrapper
verifier string The oauth_verifier string used to verify the request.
Résultat OAuthRequestWrapper

WithVersion() public méthode

Set the version of OAuth being used.
This is equivalent to setting OAuthRequestWrapper.OAuthVersion. If this is not set, then "1.0" is used.
public WithVersion ( string version ) : OAuthRequestWrapper
version string The version number to use.
Résultat OAuthRequestWrapper