diff options
Diffstat (limited to 'src/OAuth/OAuthServiceProvider/Code/Constants.cs')
-rw-r--r-- | src/OAuth/OAuthServiceProvider/Code/Constants.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/OAuth/OAuthServiceProvider/Code/Constants.cs b/src/OAuth/OAuthServiceProvider/Code/Constants.cs new file mode 100644 index 0000000..3e629f0 --- /dev/null +++ b/src/OAuth/OAuthServiceProvider/Code/Constants.cs @@ -0,0 +1,32 @@ +namespace OAuthServiceProvider.Code { + 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, Global.NonceStore); + } + } +}
\ No newline at end of file |