summaryrefslogtreecommitdiffstats
path: root/samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-04-19 08:24:54 -0400
committerAndrew Arnott <andrewarnott@gmail.com>2010-04-19 08:24:54 -0400
commitb3eeaa8855f0eca9428155c5d953fcb0502190c5 (patch)
tree060c34d8db246020d78120d2e669c1e7448d8261 /samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs
parent668c50fd19dc633bd367ac8ace37df8b5f9a5881 (diff)
downloadDotNetOpenAuth-b3eeaa8855f0eca9428155c5d953fcb0502190c5.zip
DotNetOpenAuth-b3eeaa8855f0eca9428155c5d953fcb0502190c5.tar.gz
DotNetOpenAuth-b3eeaa8855f0eca9428155c5d953fcb0502190c5.tar.bz2
Adjusted how the sample InMemoryTokenManager class is defined so that it is more difficult to use in real apps without knowing its limited scope.
Diffstat (limited to 'samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs')
-rw-r--r--samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs b/samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs
index 8b769de..b9cc2b8 100644
--- a/samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs
+++ b/samples/DotNetOpenAuth.ApplicationBlock/InMemoryTokenManager.cs
@@ -12,6 +12,7 @@ namespace DotNetOpenAuth.ApplicationBlock {
using DotNetOpenAuth.OAuth.Messages;
using DotNetOpenAuth.OpenId.Extensions.OAuth;
+#if SAMPLESONLY
/// <summary>
/// A token manager that only retains tokens in memory.
/// Meant for SHORT TERM USE TOKENS ONLY.
@@ -21,7 +22,7 @@ namespace DotNetOpenAuth.ApplicationBlock {
/// where the user only signs in without providing any authorization to access
/// Twitter APIs except to authenticate, since that access token is only useful once.
/// </remarks>
- public class InMemoryTokenManager : IConsumerTokenManager, IOpenIdOAuthTokenManager {
+ internal class InMemoryTokenManager : IConsumerTokenManager, IOpenIdOAuthTokenManager {
private Dictionary<string, string> tokensAndSecrets = new Dictionary<string, string>();
/// <summary>
@@ -140,4 +141,7 @@ namespace DotNetOpenAuth.ApplicationBlock {
#endregion
}
+#else
+#error The InMemoryTokenManager class is only for samples as it forgets all tokens whenever the application restarts! You should implement IConsumerTokenManager in your own app that stores tokens in a persistent store (like a SQL database).
+#endif
} \ No newline at end of file