summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/Messages/DirectUserToServiceProviderMessage.cs
blob: 0bf19488ca855681a87b97ff5e04015cc7cab3be (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
40
41
//-----------------------------------------------------------------------
// <copyright file="DirectUserToServiceProviderMessage.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

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

	/// <summary>
	/// A message used to redirect the user from a Consumer to a Service Provider's web site.
	/// </summary>
	internal class DirectUserToServiceProviderMessage : MessageBase {
		/// <summary>
		/// Initializes a new instance of the <see cref="DirectUserToServiceProviderMessage"/> class.
		/// </summary>
		/// <param name="serviceProvider">The URI of the Service Provider endpoint to send this message to.</param>
		internal DirectUserToServiceProviderMessage(MessageReceivingEndpoint serviceProvider)
			: base(MessageProtection.None, MessageTransport.Indirect, serviceProvider) {
		}

		/// <summary>
		/// Gets or sets the Request Token obtained in the previous step.
		/// </summary>
		/// <remarks>
		/// The Service Provider MAY declare this parameter as REQUIRED, or 
		/// accept requests to the User Authorization URL without it, in which 
		/// case it will prompt the User to enter it manually.
		/// </remarks>
		[MessagePart(Name = "oauth_token", IsRequired = false)]
		public string RequestToken { get; set; }

		/// <summary>
		/// Gets or sets a URL the Service Provider will use to redirect the User back 
		/// to the Consumer when Obtaining User Authorization is complete. Optional.
		/// </summary>
		[MessagePart(Name = "oauth_callback", IsRequired = false)]
		public Uri Callback { get; set; }
	}
}