summaryrefslogtreecommitdiffstats
path: root/samples/OAuthServiceProvider/App_Code/Constants.cs
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OAuthServiceProvider/App_Code/Constants.cs')
-rw-r--r--samples/OAuthServiceProvider/App_Code/Constants.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/samples/OAuthServiceProvider/App_Code/Constants.cs b/samples/OAuthServiceProvider/App_Code/Constants.cs
new file mode 100644
index 0000000..7780e96
--- /dev/null
+++ b/samples/OAuthServiceProvider/App_Code/Constants.cs
@@ -0,0 +1,30 @@
+using System;
+using DotNetOpenAuth.Messaging;
+using DotNetOpenAuth.OAuth;
+using DotNetOpenAuth.OAuth.ChannelElements;
+
+/// <summary>
+/// Service Provider definitions.
+/// </summary>
+public static class Constants {
+ public static Uri WebRootUrl { get; set; }
+
+ public static ServiceProviderDescription SelfDescription {
+ get {
+ ServiceProviderDescription description = new ServiceProviderDescription {
+ AccessTokenEndpoint = new MessageReceivingEndpoint(new Uri(WebRootUrl, "/OAuth.ashx"), HttpDeliveryMethods.PostRequest),
+ RequestTokenEndpoint = new MessageReceivingEndpoint(new Uri(WebRootUrl, "/OAuth.ashx"), HttpDeliveryMethods.PostRequest),
+ UserAuthorizationEndpoint = new MessageReceivingEndpoint(new Uri(WebRootUrl, "/OAuth.ashx"), HttpDeliveryMethods.PostRequest),
+ TamperProtectionElements = new ITamperProtectionChannelBindingElement[] {
+ new HmacSha1SigningBindingElement(),
+ },
+ };
+
+ return description;
+ }
+ }
+
+ public static ServiceProvider CreateServiceProvider() {
+ return new ServiceProvider(SelfDescription, Global.TokenManager);
+ }
+}