diff options
Diffstat (limited to 'samples/ServiceProvider/App_Code/Constants.cs')
-rw-r--r-- | samples/ServiceProvider/App_Code/Constants.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/samples/ServiceProvider/App_Code/Constants.cs b/samples/ServiceProvider/App_Code/Constants.cs new file mode 100644 index 0000000..7965dc0 --- /dev/null +++ b/samples/ServiceProvider/App_Code/Constants.cs @@ -0,0 +1,32 @@ +using System;
+using DotNetOAuth;
+using DotNetOAuth.ChannelElements;
+using DotNetOAuth.Messaging;
+
+/// <summary>
+/// Service Provider definitions.
+/// </summary>
+public static class Constants {
+ public static InMemoryTokenManager TokenManager { get; set; }
+
+ public static Uri WebRootUrl { get; set; }
+
+ public static ServiceProviderDescription SelfDescription {
+ get {
+ ServiceProviderDescription description = new ServiceProviderDescription {
+ AccessTokenEndpoint = new MessageReceivingEndpoint(new Uri(WebRootUrl, "/OAuth.ashx"), HttpDeliveryMethod.PostRequest),
+ RequestTokenEndpoint = new MessageReceivingEndpoint(new Uri(WebRootUrl, "/OAuth.ashx"), HttpDeliveryMethod.PostRequest),
+ UserAuthorizationEndpoint = new MessageReceivingEndpoint(new Uri(WebRootUrl, "/OAuth.ashx"), HttpDeliveryMethod.PostRequest),
+ TamperProtectionElements = new ITamperProtectionChannelBindingElement[] {
+ new HmacSha1SigningBindingElement(),
+ },
+ };
+
+ return description;
+ }
+ }
+
+ public static ServiceProvider CreateServiceProvider() {
+ return new ServiceProvider(SelfDescription, TokenManager);
+ }
+}
|