summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId/OpenId/Extensions/OAuth/AuthorizationDeclinedResponse.cs
blob: 3925a1d338f062bb6376b9a45d31e195a72a5705 (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
//-----------------------------------------------------------------------
// <copyright file="AuthorizationDeclinedResponse.cs" company="Outercurve Foundation">
//     Copyright (c) Outercurve Foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOpenAuth.OpenId.Extensions.OAuth {
	using System;

	/// <summary>
	/// The OAuth response that a Provider should include with a positive 
	/// OpenID identity assertion when OAuth authorization was declined.
	/// </summary>
	[Serializable]
	public class AuthorizationDeclinedResponse : ExtensionBase {
		/// <summary>
		/// The factory method that may be used in deserialization of this message.
		/// </summary>
		internal static readonly StandardOpenIdExtensionFactory.CreateDelegate Factory = (typeUri, data, baseMessage, isProviderRole) => {
			if (typeUri == Constants.TypeUri && !isProviderRole && !data.ContainsKey(Constants.RequestTokenParameter)) {
				return new AuthorizationDeclinedResponse();
			}

			return null;
		};

		/// <summary>
		/// Initializes a new instance of the <see cref="AuthorizationDeclinedResponse"/> class.
		/// </summary>
		public AuthorizationDeclinedResponse()
			: base(new Version(1, 0), Constants.TypeUri, null) {
		}
	}
}