diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-23 09:01:13 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-04-23 09:01:13 -0700 |
commit | a46f18685f6ab0b843a9de63bf0172ad22808033 (patch) | |
tree | 08dfd9ee709549327c108fa4883182725777a7dc /samples/OpenIdProviderMvc/Code/AnonymousIdentifierProvider.cs | |
parent | 7323ea7a7b17e6fc0c6636f4c5784d5bfe2179e9 (diff) | |
download | DotNetOpenAuth-a46f18685f6ab0b843a9de63bf0172ad22808033.zip DotNetOpenAuth-a46f18685f6ab0b843a9de63bf0172ad22808033.tar.gz DotNetOpenAuth-a46f18685f6ab0b843a9de63bf0172ad22808033.tar.bz2 |
Shorted anonymous identifier hash length, reworked the OP MVC sample to support both anonymous and identifying identifiers.
Diffstat (limited to 'samples/OpenIdProviderMvc/Code/AnonymousIdentifierProvider.cs')
-rw-r--r-- | samples/OpenIdProviderMvc/Code/AnonymousIdentifierProvider.cs | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/samples/OpenIdProviderMvc/Code/AnonymousIdentifierProvider.cs b/samples/OpenIdProviderMvc/Code/AnonymousIdentifierProvider.cs index 9ead7c1..5771279 100644 --- a/samples/OpenIdProviderMvc/Code/AnonymousIdentifierProvider.cs +++ b/samples/OpenIdProviderMvc/Code/AnonymousIdentifierProvider.cs @@ -10,7 +10,7 @@ using OpenIdProviderMvc.Models; namespace OpenIdProviderMvc.Code { internal class AnonymousIdentifierProvider : AnonymousIdentifierProviderBase { internal AnonymousIdentifierProvider() - : base(GetIdentifierBase("anon")) { + : base(Util.GetAppPathRootedUri("anon?id=")) { } protected override byte[] GetHashSaltForLocalIdentifier(Identifier localIdentifier) { @@ -22,22 +22,5 @@ namespace OpenIdProviderMvc.Code { return Convert.FromBase64String(salt); ////return AnonymousIdentifierProviderBase.GetNewSalt(5); } - - private static Uri GetIdentifierBase(string subPath) { - if (HttpContext.Current == null) { - throw new InvalidOperationException(); - } - - if (String.IsNullOrEmpty(subPath)) { - throw new ArgumentNullException("subPath"); - } - - string appPath = HttpContext.Current.Request.ApplicationPath; - if (!appPath.EndsWith("/")) { - appPath += "/"; - } - - return new Uri(HttpContext.Current.Request.Url, appPath + subPath + "/"); - } } } |