summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-02-09 23:35:41 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-02-09 23:35:41 -0800
commitbfb7f04a6c71b54b27763eccf69c3d26c0764272 (patch)
tree13fab874e73a1cf753abcbf1e2d2f40a84bfdc82 /src/DotNetOpenAuth.OAuth2
parent9a0f8c7233f2f42653a9d38255a32f79e34fa985 (diff)
downloadDotNetOpenAuth-bfb7f04a6c71b54b27763eccf69c3d26c0764272.zip
DotNetOpenAuth-bfb7f04a6c71b54b27763eccf69c3d26c0764272.tar.gz
DotNetOpenAuth-bfb7f04a6c71b54b27763eccf69c3d26c0764272.tar.bz2
Fixes OAuthConsumer twitter sample.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2')
-rw-r--r--src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs50
-rw-r--r--src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj1
2 files changed, 0 insertions, 51 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs b/src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs
deleted file mode 100644
index cc6aefc..0000000
--- a/src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="DefaultOAuth2HostFactories.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOpenAuth.OAuth2 {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net.Cache;
- using System.Net.Http;
- using System.Text;
- using System.Threading.Tasks;
-
- /// <summary>
- /// Creates default instances of required dependencies.
- /// </summary>
- public class DefaultOAuth2HostFactories : IHostFactories {
- /// <summary>
- /// Initializes a new instance of a concrete derivation of <see cref="HttpMessageHandler" />
- /// to be used for outbound HTTP traffic.
- /// </summary>
- /// <returns>An instance of <see cref="HttpMessageHandler"/>.</returns>
- /// <remarks>
- /// An instance of <see cref="WebRequestHandler" /> is recommended where available;
- /// otherwise an instance of <see cref="HttpClientHandler" /> is recommended.
- /// </remarks>
- public virtual HttpMessageHandler CreateHttpMessageHandler() {
- var handler = new HttpClientHandler();
- return handler;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="HttpClient" /> class
- /// to be used for outbound HTTP traffic.
- /// </summary>
- /// <param name="handler">The handler to pass to the <see cref="HttpClient" /> constructor.
- /// May be null to use the default that would be provided by <see cref="CreateHttpMessageHandler" />.</param>
- /// <returns>
- /// An instance of <see cref="HttpClient" />.
- /// </returns>
- public HttpClient CreateHttpClient(HttpMessageHandler handler) {
- handler = handler ?? this.CreateHttpMessageHandler();
- var client = new HttpClient(handler);
- client.DefaultRequestHeaders.UserAgent.Add(Util.LibraryVersionHeader);
- return client;
- }
- }
-}
diff --git a/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj b/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj
index 1cf7fd2..d0c3626 100644
--- a/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj
+++ b/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj
@@ -20,7 +20,6 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Configuration\OAuth2SectionGroup.cs" />
- <Compile Include="DefaultOAuth2HostFactories.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="OAuth2\AccessToken.cs" />
<Compile Include="OAuth2\ChannelElements\AuthorizationDataBag.cs" />