diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-02-26 22:55:18 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-02-26 22:55:18 -0800 |
commit | 6204dcf07f31b78478bc1ddb55a6ca9027617b67 (patch) | |
tree | 2b92fff13f9e253c9504e73b677ec61b352d9f38 /src/DotNetOpenAuth.OAuth.Consumer | |
parent | 38a1162c5cbaea035e655dc9accd92f9de5019ed (diff) | |
download | DotNetOpenAuth-6204dcf07f31b78478bc1ddb55a6ca9027617b67.zip DotNetOpenAuth-6204dcf07f31b78478bc1ddb55a6ca9027617b67.tar.gz DotNetOpenAuth-6204dcf07f31b78478bc1ddb55a6ca9027617b67.tar.bz2 |
Fixes some OAuth 1 build breaks.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth.Consumer')
-rw-r--r-- | src/DotNetOpenAuth.OAuth.Consumer/DotNetOpenAuth.OAuth.Consumer.csproj | 1 | ||||
-rw-r--r-- | src/DotNetOpenAuth.OAuth.Consumer/OAuth/ServiceProviderDescription.cs | 84 |
2 files changed, 85 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OAuth.Consumer/DotNetOpenAuth.OAuth.Consumer.csproj b/src/DotNetOpenAuth.OAuth.Consumer/DotNetOpenAuth.OAuth.Consumer.csproj index fe14abc..173bb3e 100644 --- a/src/DotNetOpenAuth.OAuth.Consumer/DotNetOpenAuth.OAuth.Consumer.csproj +++ b/src/DotNetOpenAuth.OAuth.Consumer/DotNetOpenAuth.OAuth.Consumer.csproj @@ -29,6 +29,7 @@ <Compile Include="OAuth\OAuth1HttpMessageHandlerBase.cs" /> <Compile Include="OAuth\OAuth1PlainTextMessageHandler.cs" /> <Compile Include="OAuth\OAuth1RsaSha1HttpMessageHandler.cs" /> + <Compile Include="OAuth\ServiceProviderDescription.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType> </SubType> diff --git a/src/DotNetOpenAuth.OAuth.Consumer/OAuth/ServiceProviderDescription.cs b/src/DotNetOpenAuth.OAuth.Consumer/OAuth/ServiceProviderDescription.cs new file mode 100644 index 0000000..e6a2b32 --- /dev/null +++ b/src/DotNetOpenAuth.OAuth.Consumer/OAuth/ServiceProviderDescription.cs @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------- +// <copyright file="ServiceProviderDescription.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace DotNetOpenAuth.OAuth { + using System; + using System.Collections.Generic; + using System.Linq; + using System.Net.Http; + using System.Text; + using System.Threading.Tasks; + using Validation; + + /// <summary> + /// Describes an OAuth 1.0 service provider. + /// </summary> + public class ServiceProviderDescription { + /// <summary> + /// Initializes a new instance of the <see cref="ServiceProviderDescription" /> class. + /// </summary> + public ServiceProviderDescription() { + this.TemporaryCredentialsRequestEndpointMethod = HttpMethod.Post; + this.TokenRequestEndpointMethod = HttpMethod.Post; + } + + /// <summary> + /// Initializes a new instance of the <see cref="ServiceProviderDescription"/> class. + /// </summary> + /// <param name="temporaryCredentialsRequestEndpoint">The temporary credentials request endpoint.</param> + /// <param name="resourceOwnerAuthorizationEndpoint">The resource owner authorization endpoint.</param> + /// <param name="tokenRequestEndpoint">The token request endpoint.</param> + public ServiceProviderDescription( + string temporaryCredentialsRequestEndpoint, string resourceOwnerAuthorizationEndpoint, string tokenRequestEndpoint) { + if (temporaryCredentialsRequestEndpoint != null) { + this.TemporaryCredentialsRequestEndpoint = new Uri(temporaryCredentialsRequestEndpoint, UriKind.Absolute); + } + + if (resourceOwnerAuthorizationEndpoint != null) { + this.ResourceOwnerAuthorizationEndpoint = new Uri(resourceOwnerAuthorizationEndpoint, UriKind.Absolute); + } + + if (tokenRequestEndpoint != null) { + this.TokenRequestEndpoint = new Uri(tokenRequestEndpoint, UriKind.Absolute); + } + } + + /// <summary> + /// Gets or sets the temporary credentials request endpoint. + /// </summary> + /// <value> + /// The temporary credentials request endpoint. + /// </value> + public Uri TemporaryCredentialsRequestEndpoint { get; set; } + + /// <summary> + /// Gets or sets the HTTP method to use with the temporary credentials request endpoint. + /// </summary> + public HttpMethod TemporaryCredentialsRequestEndpointMethod { get; set; } + + /// <summary> + /// Gets the resource owner authorization endpoint. + /// </summary> + /// <value> + /// The resource owner authorization endpoint. + /// May be <c>null</c> for 2-legged OAuth. + /// </value> + public Uri ResourceOwnerAuthorizationEndpoint { get; set; } + + /// <summary> + /// Gets the token request endpoint. + /// </summary> + /// <value> + /// The token request endpoint. + /// </value> + public Uri TokenRequestEndpoint { get; set; } + + /// <summary> + /// Gets or sets the HTTP method to use with the token request endpoint. + /// </summary> + public HttpMethod TokenRequestEndpointMethod { get; set; } + } +} |