summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messages/DirectUserToConsumerMessage.cs
blob: 1f4cdcdb8dd639e75463993f06b07fc0ca0263a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//-----------------------------------------------------------------------
// <copyright file="DirectUserToConsumerMessage.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOAuth.Messages {
	using System;
	using System.Runtime.Serialization;
	using DotNetOAuth.Messaging;

	internal class DirectUserToConsumerMessage : MessageBase, IDirectedProtocolMessage {
		private Uri consumer;

		internal DirectUserToConsumerMessage(Uri consumer) {
			this.consumer = consumer;
		}

		// TODO: graph in spec says this is optional, but in text is suggests it is required.
		[MessagePart(Name = "oauth_token", IsRequired = true)]
		public string RequestToken { get; set; }

		protected override MessageTransport Transport {
			get { return MessageTransport.Indirect; }
		}

		protected override MessageProtection RequiredProtection {
			get { return MessageProtection.None; }
		}

		#region IDirectedProtocolMessage Members

		Uri IDirectedProtocolMessage.Recipient {
			get { return this.consumer; }
		}

		#endregion
	}
}