summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs1
-rw-r--r--samples/OAuthServiceProvider/Code/OAuthConsumer.cs14
-rw-r--r--src/DotNetOpenAuth/DotNetOpenAuth.csproj1
-rw-r--r--src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs1
-rw-r--r--src/DotNetOpenAuth/OAuth2/IConsumerDescription.cs26
-rw-r--r--src/DotNetOpenAuth/OAuth2/OAuthUtilities.cs3
6 files changed, 41 insertions, 5 deletions
diff --git a/samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs b/samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs
index a0234e2..00503c4 100644
--- a/samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs
+++ b/samples/OAuthServiceProvider/Code/OAuth2AuthorizationServer.cs
@@ -6,7 +6,6 @@
using System.Web;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
- using DotNetOpenAuth.OAuth.ChannelElements;
using DotNetOpenAuth.OAuth2;
using DotNetOpenAuth.OAuth2.ChannelElements;
diff --git a/samples/OAuthServiceProvider/Code/OAuthConsumer.cs b/samples/OAuthServiceProvider/Code/OAuthConsumer.cs
index d7dfc06..8291929 100644
--- a/samples/OAuthServiceProvider/Code/OAuthConsumer.cs
+++ b/samples/OAuthServiceProvider/Code/OAuthConsumer.cs
@@ -11,7 +11,7 @@ namespace OAuthServiceProvider.Code {
using System.Web;
using DotNetOpenAuth.OAuth.ChannelElements;
- public partial class OAuthConsumer : IConsumerDescription {
+ public partial class OAuthConsumer : IConsumerDescription, DotNetOpenAuth.OAuth2.IConsumerDescription {
#region IConsumerDescription Members
string IConsumerDescription.Key {
@@ -39,5 +39,17 @@ namespace OAuthServiceProvider.Code {
}
#endregion
+
+ #region IConsumerDescription Members
+
+ string DotNetOpenAuth.OAuth2.IConsumerDescription.Secret {
+ get { return this.ConsumerSecret; }
+ }
+
+ Uri DotNetOpenAuth.OAuth2.IConsumerDescription.Callback {
+ get { return string.IsNullOrEmpty(this.Callback) ? null : new Uri(this.Callback); }
+ }
+
+ #endregion
}
} \ No newline at end of file
diff --git a/src/DotNetOpenAuth/DotNetOpenAuth.csproj b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
index bc64780..9819396 100644
--- a/src/DotNetOpenAuth/DotNetOpenAuth.csproj
+++ b/src/DotNetOpenAuth/DotNetOpenAuth.csproj
@@ -329,6 +329,7 @@ http://opensource.org/licenses/ms-pl.html
<Compile Include="OAuth2\IAuthorizationServer.cs" />
<Compile Include="OAuth2\IAuthorizationState.cs" />
<Compile Include="OAuth2\IClientTokenManager.cs" />
+ <Compile Include="OAuth2\IConsumerDescription.cs" />
<Compile Include="OAuth2\Messages\AccessProtectedResourceRequest.cs" />
<Compile Include="OAuth2\Messages\Assertion\AssertionRequest.cs" />
<Compile Include="OAuth2\Messages\ClientCredentials\ClientCredentialsRequest.cs" />
diff --git a/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs b/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs
index b302651..c99fbc3 100644
--- a/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs
+++ b/src/DotNetOpenAuth/OAuth2/IAuthorizationServer.cs
@@ -12,7 +12,6 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Security.Cryptography;
using System.Text;
using DotNetOpenAuth.Messaging.Bindings;
- using DotNetOpenAuth.OAuth.ChannelElements;
using DotNetOpenAuth.OAuth2.ChannelElements;
/// <summary>
diff --git a/src/DotNetOpenAuth/OAuth2/IConsumerDescription.cs b/src/DotNetOpenAuth/OAuth2/IConsumerDescription.cs
new file mode 100644
index 0000000..f0fc20a
--- /dev/null
+++ b/src/DotNetOpenAuth/OAuth2/IConsumerDescription.cs
@@ -0,0 +1,26 @@
+//-----------------------------------------------------------------------
+// <copyright file="IConsumerDescription.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.OAuth2 {
+ using System;
+ using System.Security.Cryptography.X509Certificates;
+
+ /// <summary>
+ /// A description of a consumer from a Service Provider's point of view.
+ /// </summary>
+ public interface IConsumerDescription {
+ /// <summary>
+ /// Gets the consumer secret.
+ /// </summary>
+ string Secret { get; }
+
+ /// <summary>
+ /// Gets the callback URI that this consumer has pre-registered with the service provider, if any.
+ /// </summary>
+ /// <value>A URI that user authorization responses should be directed to; or <c>null</c> if no preregistered callback was arranged.</value>
+ Uri Callback { get; }
+ }
+}
diff --git a/src/DotNetOpenAuth/OAuth2/OAuthUtilities.cs b/src/DotNetOpenAuth/OAuth2/OAuthUtilities.cs
index fba80b5..ccc7e8d 100644
--- a/src/DotNetOpenAuth/OAuth2/OAuthUtilities.cs
+++ b/src/DotNetOpenAuth/OAuth2/OAuthUtilities.cs
@@ -13,7 +13,6 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Net;
using System.Text;
using DotNetOpenAuth.Messaging;
- using DotNetOpenAuth.OAuth.ChannelElements;
/// <summary>
/// Some common utility methods for OAuth 2.0.
@@ -41,7 +40,7 @@ namespace DotNetOpenAuth.OAuth2 {
/// <returns>The client information. Never null.</returns>
internal static IConsumerDescription GetClientOrThrow(this IAuthorizationServer authorizationServer, string clientIdentifier) {
Contract.Requires<ArgumentException>(!String.IsNullOrEmpty(clientIdentifier));
- Contract.Ensures(Contract.Result<DotNetOpenAuth.OAuth.ChannelElements.IConsumerDescription>() != null);
+ Contract.Ensures(Contract.Result<IConsumerDescription>() != null);
try {
return authorizationServer.GetClient(clientIdentifier);