diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-11-11 20:41:08 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-11-11 20:41:08 -0800 |
commit | 31376a37a587523c5b80dbcf3f21b26f1a6bcb76 (patch) | |
tree | 67a143e64a7983390fe4ae6f5105130bb90ad667 /src/DotNetOpenAuth.Test/OAuth2/OAuth2TestBase.cs | |
parent | 5575ed58c0b9d0c6b0c19eace2a8af4c8666c5eb (diff) | |
download | DotNetOpenAuth-31376a37a587523c5b80dbcf3f21b26f1a6bcb76.zip DotNetOpenAuth-31376a37a587523c5b80dbcf3f21b26f1a6bcb76.tar.gz DotNetOpenAuth-31376a37a587523c5b80dbcf3f21b26f1a6bcb76.tar.bz2 |
Adds more token decoding tests.
Diffstat (limited to 'src/DotNetOpenAuth.Test/OAuth2/OAuth2TestBase.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/OAuth2/OAuth2TestBase.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Test/OAuth2/OAuth2TestBase.cs b/src/DotNetOpenAuth.Test/OAuth2/OAuth2TestBase.cs index f43a349..b9e32fe 100644 --- a/src/DotNetOpenAuth.Test/OAuth2/OAuth2TestBase.cs +++ b/src/DotNetOpenAuth.Test/OAuth2/OAuth2TestBase.cs @@ -8,6 +8,7 @@ namespace DotNetOpenAuth.Test.OAuth2 { using System; using System.Collections.Generic; using System.Linq; + using System.Security.Cryptography; using System.Text; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.Messaging.Bindings; @@ -29,6 +30,8 @@ namespace DotNetOpenAuth.Test.OAuth2 { protected static readonly Uri ClientCallback = new Uri("http://client/callback"); + protected static readonly RSACryptoServiceProvider AsymmetricKey = new RSACryptoServiceProvider(512); + protected static readonly AuthorizationServerDescription AuthorizationServerDescription = new AuthorizationServerDescription { AuthorizationEndpoint = new Uri("https://authserver/authorize"), TokenEndpoint = new Uri("https://authserver/token"), @@ -55,7 +58,7 @@ namespace DotNetOpenAuth.Test.OAuth2 { MessagingUtilities.AreEquivalent(d.Scope, TestScopes)))).Returns(true); string canonicalUserName = ResourceOwnerUsername; authHostMock.Setup(m => m.TryAuthorizeResourceOwnerCredentialGrant(ResourceOwnerUsername, ResourceOwnerPassword, It.IsAny<IAccessTokenRequest>(), out canonicalUserName)).Returns(true); - authHostMock.Setup(m => m.CreateAccessToken(It.IsAny<IAccessTokenRequest>())).Returns(new AccessTokenResult(new AuthorizationServerAccessToken())); + authHostMock.Setup(m => m.CreateAccessToken(It.IsAny<IAccessTokenRequest>())).Returns(new AccessTokenResult(new AuthorizationServerAccessToken() { AccessTokenSigningKey = AsymmetricKey })); return authHostMock; } } |