diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-10-07 21:36:29 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-10-07 21:36:29 -0700 |
commit | 29d897769f3e7a9568fa668836807d9a31b5fabc (patch) | |
tree | fb9a91e0804ed5a92d183268309ea0234732682b /samples/ServiceProvider/App_Code/RequestScopedTokenMessage.cs | |
parent | 43188751fe5c64c8f29f62e448a2c6a798910328 (diff) | |
download | DotNetOpenAuth-29d897769f3e7a9568fa668836807d9a31b5fabc.zip DotNetOpenAuth-29d897769f3e7a9568fa668836807d9a31b5fabc.tar.gz DotNetOpenAuth-29d897769f3e7a9568fa668836807d9a31b5fabc.tar.bz2 |
Added strong-typed request token message to sample.
This proves that messages can be derived from and tailored to provide type-safe additions where the OAuth protocol permits it.
As can be seen, several more types and members had to be made public for this to work.
Diffstat (limited to 'samples/ServiceProvider/App_Code/RequestScopedTokenMessage.cs')
-rw-r--r-- | samples/ServiceProvider/App_Code/RequestScopedTokenMessage.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/samples/ServiceProvider/App_Code/RequestScopedTokenMessage.cs b/samples/ServiceProvider/App_Code/RequestScopedTokenMessage.cs new file mode 100644 index 0000000..e8dbdeb --- /dev/null +++ b/samples/ServiceProvider/App_Code/RequestScopedTokenMessage.cs @@ -0,0 +1,20 @@ +using DotNetOAuth.Messages;
+using DotNetOAuth.Messaging;
+
+/// <summary>
+/// A custom web app version of the message sent to request an unauthorized token.
+/// </summary>
+public class RequestScopedTokenMessage : RequestTokenMessage {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RequestScopedTokenMessage"/> class.
+ /// </summary>
+ /// <param name="endpoint">The endpoint that will receive the message.</param>
+ public RequestScopedTokenMessage(MessageReceivingEndpoint endpoint) : base(endpoint) {
+ }
+
+ /// <summary>
+ /// Gets or sets the scope of the access being requested.
+ /// </summary>
+ [MessagePart("scope", IsRequired = true)]
+ public string Scope { get; set; }
+}
|