summaryrefslogtreecommitdiffstats
path: root/samples/OAuth2ProtectedWebApi
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-03-02 16:17:00 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-03-02 16:17:00 -0800
commit09651b96839ce22116a4047876bb5a43164c1102 (patch)
tree6070c5be6968067f05eef42bb234c4a1af0881e1 /samples/OAuth2ProtectedWebApi
parent15997d4073e67ead1493b4133c1858fea09620ff (diff)
downloadDotNetOpenAuth-09651b96839ce22116a4047876bb5a43164c1102.zip
DotNetOpenAuth-09651b96839ce22116a4047876bb5a43164c1102.tar.gz
DotNetOpenAuth-09651b96839ce22116a4047876bb5a43164c1102.tar.bz2
Removes trivial nonce store implementation from WebAPI sample.
Diffstat (limited to 'samples/OAuth2ProtectedWebApi')
-rw-r--r--samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs9
-rw-r--r--samples/OAuth2ProtectedWebApi/Code/MemoryNonceStore.cs14
-rw-r--r--samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj1
3 files changed, 5 insertions, 19 deletions
diff --git a/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs b/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs
index 73c5864..3149923 100644
--- a/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs
+++ b/samples/OAuth2ProtectedWebApi/Code/AuthorizationServerHost.cs
@@ -12,14 +12,15 @@
public class AuthorizationServerHost : IAuthorizationServerHost {
private static ICryptoKeyStore cryptoKeyStore = MemoryCryptoKeyStore.Instance;
- private static INonceStore nonceStore = new MemoryNonceStore();
-
public ICryptoKeyStore CryptoKeyStore {
get { return cryptoKeyStore; }
}
public INonceStore NonceStore {
- get { return nonceStore; }
+ get {
+ // Implementing a nonce store is a good idea as it mitigates replay attacks.
+ return null;
+ }
}
public AccessTokenResult CreateAccessToken(IAccessTokenRequest accessTokenRequestMessage) {
@@ -31,7 +32,7 @@
}
public IClientDescription GetClient(string clientIdentifier) {
- return new ClientDescription("zzz", new Uri("http://www.microsoft.com/en-us/default.aspx"), ClientType.Confidential);
+ return new ClientDescription("b", new Uri("http://www.microsoft.com/en-us/default.aspx"), ClientType.Confidential);
}
public bool IsAuthorizationValid(IAuthorizationDescription authorization) {
diff --git a/samples/OAuth2ProtectedWebApi/Code/MemoryNonceStore.cs b/samples/OAuth2ProtectedWebApi/Code/MemoryNonceStore.cs
deleted file mode 100644
index 3bec259..0000000
--- a/samples/OAuth2ProtectedWebApi/Code/MemoryNonceStore.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace OAuth2ProtectedWebApi.Code {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
-
- using DotNetOpenAuth.Messaging.Bindings;
-
- internal class MemoryNonceStore : INonceStore {
- public bool StoreNonce(string context, string nonce, DateTime timestampUtc) {
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj b/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj
index 811ba5a..321d808 100644
--- a/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj
+++ b/samples/OAuth2ProtectedWebApi/OAuth2ProtectedWebApi.csproj
@@ -129,7 +129,6 @@
<Compile Include="Code\BearerTokenHandler.cs" />
<Compile Include="Code\HttpHeaderAttribute.cs" />
<Compile Include="Code\MemoryCryptoKeyStore.cs" />
- <Compile Include="Code\MemoryNonceStore.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\TokenController.cs" />
<Compile Include="Controllers\UserController.cs" />