Пример #1
0
 /// <summary>
 /// Creates an OAuthService using defaults for most parameters, loading components
 /// from the current global service locator.
 /// </summary>
 /// <remarks>
 /// <para>The OAuthService created will have the following defaults:</para>
 /// <list type="table">
 ///     <listheader>
 ///         <term>Property</term>
 ///         <description>Value</description>
 ///     </listheader>
 ///     <item>
 ///         <term>HttpMethod</term>
 ///         <description><c>"POST"</c></description>
 ///     </item>
 ///     <item>
 ///         <term>UseAuthorizationHeader</term>
 ///         <description><c>true</c></description>
 ///     </item>
 ///     <item>
 ///         <term>Realm</term>
 ///         <description><c>null</c></description>
 ///     </item>
 ///     <item>
 ///         <term>SignatureMethod</term>
 ///         <description><c>"HMAC-SHA1"</c></description>
 ///     </item>
 ///     <item>
 ///         <term>OAuthVersion</term>
 ///         <description><c>"1.0"</c></description>
 ///     </item>
 ///     <item>
 ///         <term>ConfigSection</term>
 ///         <description><c>"oauth.net.consumer"</c></description>
 ///     </item>
 /// </list>
 /// </remarks>
 /// <param name="requestTokenEndPoint">EndPoint for obtaining request tokens</param>
 /// <param name="authorizationUrl">URL to send users to for authorization</param>
 /// <param name="accessTokenEndPoint">EndPoint for obtaining access tokens</param>
 /// <param name="consumer">Consumer credentials</param>
 /// <returns>An OAuthService</returns>
 public static OAuthService Create(
     EndPoint requestTokenEndPoint,
     Uri authorizationUrl,
     EndPoint accessTokenEndPoint,
     IConsumer consumer)
 {
     return(OAuthService.Create(
                requestTokenEndPoint,
                authorizationUrl,
                accessTokenEndPoint,
                true,
                null,
                "HMAC-SHA1",
                Constants.Version1_0,
                consumer,
                () => ServiceLocator.Current));
 }
Пример #2
0
 /// <summary>
 /// Creates an OAuthService using defaults for most parameters, loading components
 /// from the service locator provided by the supplied provider.
 /// </summary>
 /// <remarks>
 /// <para>The OAuthService created will have the following defaults:</para>
 /// <list type="table">
 ///     <listheader>
 ///         <term>Property</term>
 ///         <description>Value</description>
 ///     </listheader>
 ///     <item>
 ///         <term>HttpMethod</term>
 ///         <description><c>"POST"</c></description>
 ///     </item>
 ///     <item>
 ///         <term>UseAuthorizationHeader</term>
 ///         <description><c>true</c></description>
 ///     </item>
 ///     <item>
 ///         <term>Realm</term>
 ///         <description><c>null</c></description>
 ///     </item>
 ///     <item>
 ///         <term>OAuthVersion</term>
 ///         <description><c>"1.0"</c></description>
 ///     </item>
 /// </list>
 /// </remarks>
 /// <param name="requestTokenEndPoint">EndPoint for obtaining request tokens</param>
 /// <param name="authorizationUrl">URL to send users to for authorization</param>
 /// <param name="accessTokenEndPoint">EndPoint for obtaining access tokens</param>
 /// <param name="signatureMethod">Signature method to use</param>
 /// <param name="consumer">Consumer credentials</param>
 /// <param name="serviceLocatorProvider">Service locator provider which provides
 /// a service locator for components</param>
 /// <returns>An OAuthService</returns>
 public static OAuthService Create(
     EndPoint requestTokenEndPoint,
     Uri authorizationUrl,
     EndPoint accessTokenEndPoint,
     string signatureMethod,
     IConsumer consumer,
     ServiceLocatorProvider serviceLocatorProvider)
 {
     return(OAuthService.Create(
                requestTokenEndPoint,
                authorizationUrl,
                accessTokenEndPoint,
                true,
                null,
                signatureMethod,
                Constants.Version1_0,
                consumer,
                serviceLocatorProvider));
 }
Пример #3
0
 public static OAuthService Create(
     EndPoint requestTokenEndPoint,
     Uri authorizationUrl,
     EndPoint accessTokenEndPoint,
     bool useAuthorizationHeader,
     string realm,
     string signatureMethod,
     string oauthVersion,
     IConsumer consumer)
 {
     return(OAuthService.Create(
                requestTokenEndPoint,
                authorizationUrl,
                accessTokenEndPoint,
                useAuthorizationHeader,
                realm,
                signatureMethod,
                oauthVersion,
                consumer,
                () => ServiceLocator.Current));
 }