summaryrefslogtreecommitdiffstats
path: root/samples/OAuthConsumer/App_Code/InMemoryTokenManager.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-02-24 07:55:41 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-02-24 08:02:07 -0800
commit5c4b3986ea5ea2f72407a2ce613403e06b0b5b4b (patch)
tree5d79b73996bc2688b58913f3b48cdc970bce6565 /samples/OAuthConsumer/App_Code/InMemoryTokenManager.cs
parent79b38d534537eec6b3e49bd428e768f600a3d370 (diff)
downloadDotNetOpenAuth-5c4b3986ea5ea2f72407a2ce613403e06b0b5b4b.zip
DotNetOpenAuth-5c4b3986ea5ea2f72407a2ce613403e06b0b5b4b.tar.gz
DotNetOpenAuth-5c4b3986ea5ea2f72407a2ce613403e06b0b5b4b.tar.bz2
Added Sign In with Twitter sample.
Diffstat (limited to 'samples/OAuthConsumer/App_Code/InMemoryTokenManager.cs')
-rw-r--r--samples/OAuthConsumer/App_Code/InMemoryTokenManager.cs54
1 files changed, 0 insertions, 54 deletions
diff --git a/samples/OAuthConsumer/App_Code/InMemoryTokenManager.cs b/samples/OAuthConsumer/App_Code/InMemoryTokenManager.cs
deleted file mode 100644
index 120f00a..0000000
--- a/samples/OAuthConsumer/App_Code/InMemoryTokenManager.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="InMemoryTokenManager.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using DotNetOpenAuth.OAuth.ChannelElements;
-using DotNetOpenAuth.OAuth.Messages;
-
-public class InMemoryTokenManager : IConsumerTokenManager {
- private Dictionary<string, string> tokensAndSecrets = new Dictionary<string, string>();
-
- public InMemoryTokenManager(string consumerKey, string consumerSecret) {
- if (String.IsNullOrEmpty(consumerKey)) {
- throw new ArgumentNullException("consumerKey");
- }
-
- this.ConsumerKey = consumerKey;
- this.ConsumerSecret = consumerSecret;
- }
-
- public string ConsumerKey { get; private set; }
-
- public string ConsumerSecret { get; private set; }
-
- #region ITokenManager Members
-
- public string GetTokenSecret(string token) {
- return this.tokensAndSecrets[token];
- }
-
- public void StoreNewRequestToken(UnauthorizedTokenRequest request, ITokenSecretContainingMessage response) {
- this.tokensAndSecrets[response.Token] = response.TokenSecret;
- }
-
- public void ExpireRequestTokenAndStoreNewAccessToken(string consumerKey, string requestToken, string accessToken, string accessTokenSecret) {
- this.tokensAndSecrets.Remove(requestToken);
- this.tokensAndSecrets[accessToken] = accessTokenSecret;
- }
-
- /// <summary>
- /// Classifies a token as a request token or an access token.
- /// </summary>
- /// <param name="token">The token to classify.</param>
- /// <returns>Request or Access token, or invalid if the token is not recognized.</returns>
- public TokenType GetTokenType(string token) {
- throw new NotImplementedException();
- }
-
- #endregion
-}