summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messaging/Bindings/NonceMemoryStore.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-21 21:38:41 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-21 21:38:41 -0700
commitf80ac82be5e9432806ce35b7025b007246d74147 (patch)
tree9e194bfa753d03ea4deb2a02ffcd7f7db35cad0d /src/DotNetOAuth/Messaging/Bindings/NonceMemoryStore.cs
parent2c381fbe2d2598e9549f5646d7bac40e49803760 (diff)
downloadDotNetOpenAuth-f80ac82be5e9432806ce35b7025b007246d74147.zip
DotNetOpenAuth-f80ac82be5e9432806ce35b7025b007246d74147.tar.gz
DotNetOpenAuth-f80ac82be5e9432806ce35b7025b007246d74147.tar.bz2
Adding the binding elements necessary for basic OAuth functionality.
Diffstat (limited to 'src/DotNetOAuth/Messaging/Bindings/NonceMemoryStore.cs')
-rw-r--r--src/DotNetOAuth/Messaging/Bindings/NonceMemoryStore.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messaging/Bindings/NonceMemoryStore.cs b/src/DotNetOAuth/Messaging/Bindings/NonceMemoryStore.cs
new file mode 100644
index 0000000..29e1547
--- /dev/null
+++ b/src/DotNetOAuth/Messaging/Bindings/NonceMemoryStore.cs
@@ -0,0 +1,48 @@
+//-----------------------------------------------------------------------
+// <copyright file="NonceMemoryStore.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOAuth.Messaging.Bindings {
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Text;
+ using DotNetOAuth.Messaging.Bindings;
+
+ /// <summary>
+ /// An in-memory nonce store. Useful for single-server web applications.
+ /// NOT for web farms.
+ /// </summary>
+ internal class NonceMemoryStore : INonceStore {
+ #region INonceStore Members
+
+ /// <summary>
+ /// Stores a given nonce and timestamp.
+ /// </summary>
+ /// <param name="nonce">
+ /// A series of random characters.
+ /// </param>
+ /// <param name="timestamp">
+ /// The timestamp that together with the nonce string make it unique.
+ /// The timestamp may also be used by the data store to clear out old nonces.
+ /// </param>
+ /// <returns>
+ /// True if the nonce+timestamp (combination) was not previously in the database.
+ /// False if the nonce was stored previously with the same timestamp.
+ /// </returns>
+ /// <remarks>
+ /// The nonce must be stored for no less than the maximum time window a message may
+ /// be processed within before being discarded as an expired message.
+ /// If the binding element is applicable to your channel, this expiration window
+ /// is retrieved or set using the
+ /// <see cref="StandardExpirationBindingElement.MaximumMessageAge"/> property.
+ /// </remarks>
+ public bool StoreNonce(string nonce, DateTime timestamp) {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+ }
+}