summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-03-01 21:22:52 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-03-01 21:22:52 -0800
commitbb7549901264bf51276bdd33cab293b83a7fcceb (patch)
treeecd95f4d7abea7dd1d8fbd7be0b565266ee5ce19 /src/DotNetOpenAuth.OAuth2
parent9b403a0a59e0385e5a2a7e95e3053de7f0e90a34 (diff)
downloadDotNetOpenAuth-bb7549901264bf51276bdd33cab293b83a7fcceb.zip
DotNetOpenAuth-bb7549901264bf51276bdd33cab293b83a7fcceb.tar.gz
DotNetOpenAuth-bb7549901264bf51276bdd33cab293b83a7fcceb.tar.bz2
Adds support for symmetric key signing and encryption of access tokens.
This targets the common scenario where authorization servers and resource servers are actually on the same web application, and asymmetric cryptography is overkill and requires extra setup.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2')
-rw-r--r--src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs b/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
index fa87972..a8c911e 100644
--- a/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
+++ b/src/DotNetOpenAuth.OAuth2/OAuth2/AccessToken.cs
@@ -57,6 +57,15 @@ namespace DotNetOpenAuth.OAuth2 {
}
/// <summary>
+ /// Creates a formatter capable of serializing/deserializing an access token.
+ /// </summary>
+ /// <returns>An access token serializer.</returns>
+ internal static IDataBagFormatter<AccessToken> CreateFormatter(ICryptoKeyStore symmetricKeyStore) {
+ Requires.NotNull(symmetricKeyStore, "symmetricKeyStore");
+ return new UriStyleMessageFormatter<AccessToken>(symmetricKeyStore, bucket: "AccessTokens", signed: true, encrypted: true);
+ }
+
+ /// <summary>
/// Initializes this instance of the <see cref="AccessToken"/> class.
/// </summary>
/// <param name="authorization">The authorization to apply to this access token.</param>