diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-11-03 16:02:57 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-11-03 16:02:57 -0800 |
commit | aa1f55f58a561ff64dc268977d0d7c9decb92bbe (patch) | |
tree | fd685f00353d26493b40df7eaeac78745e27d1b8 /src/DotNetOAuth/OAuth/ChannelElements/ITokenGenerator.cs | |
parent | f1794fc8779ae39ac3d5bc6e8b811523e62ca482 (diff) | |
download | DotNetOpenAuth-aa1f55f58a561ff64dc268977d0d7c9decb92bbe.zip DotNetOpenAuth-aa1f55f58a561ff64dc268977d0d7c9decb92bbe.tar.gz DotNetOpenAuth-aa1f55f58a561ff64dc268977d0d7c9decb92bbe.tar.bz2 |
Moved all the OAuth classes into its own namespace in preparation to receiving DotNetOpenId merge.
Diffstat (limited to 'src/DotNetOAuth/OAuth/ChannelElements/ITokenGenerator.cs')
-rw-r--r-- | src/DotNetOAuth/OAuth/ChannelElements/ITokenGenerator.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/DotNetOAuth/OAuth/ChannelElements/ITokenGenerator.cs b/src/DotNetOAuth/OAuth/ChannelElements/ITokenGenerator.cs new file mode 100644 index 0000000..888ba05 --- /dev/null +++ b/src/DotNetOAuth/OAuth/ChannelElements/ITokenGenerator.cs @@ -0,0 +1,40 @@ +//-----------------------------------------------------------------------
+// <copyright file="ITokenGenerator.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOAuth.OAuth.ChannelElements {
+ /// <summary>
+ /// An interface allowing OAuth hosts to inject their own algorithm for generating tokens and secrets.
+ /// </summary>
+ public interface ITokenGenerator {
+ /// <summary>
+ /// Generates a new token to represent a not-yet-authorized request to access protected resources.
+ /// </summary>
+ /// <param name="consumerKey">The consumer that requested this token.</param>
+ /// <returns>The newly generated token.</returns>
+ /// <remarks>
+ /// This method should not store the newly generated token in any persistent store.
+ /// This will be done in <see cref="ITokenManager.StoreNewRequestToken"/>.
+ /// </remarks>
+ string GenerateRequestToken(string consumerKey);
+
+ /// <summary>
+ /// Generates a new token to represent an authorized request to access protected resources.
+ /// </summary>
+ /// <param name="consumerKey">The consumer that requested this token.</param>
+ /// <returns>The newly generated token.</returns>
+ /// <remarks>
+ /// This method should not store the newly generated token in any persistent store.
+ /// This will be done in <see cref="ITokenManager.ExpireRequestTokenAndStoreNewAccessToken"/>.
+ /// </remarks>
+ string GenerateAccessToken(string consumerKey);
+
+ /// <summary>
+ /// Returns a cryptographically strong random string for use as a token secret.
+ /// </summary>
+ /// <returns>The generated string.</returns>
+ string GenerateSecret();
+ }
+}
|