1
//-----------------------------------------------------------------------
2 // <copyright file="DirectErrorResponse.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth
.OpenId
.Messages
{
8 using DotNetOpenAuth
.Messaging
;
11 /// A message sent from a Provider to a Relying Party in response to a direct message request that resulted in an error.
14 /// This message must be sent with an HTTP status code of 400.
15 /// This class satisfies OpenID 2.0 section 5.1.2.2.
17 internal class DirectErrorResponse
: DirectResponseBase
, IHttpDirectResponse
{
19 /// Initializes a new instance of the <see cref="DirectErrorResponse"/> class.
21 /// <param name="originatingRequest">The originating request.</param>
22 internal DirectErrorResponse(IDirectedProtocolMessage originatingRequest
)
23 : base(originatingRequest
) {
26 #region IHttpDirectResponse Members
29 /// Gets the HTTP status code that the direct respones should be sent with.
31 /// <value><see cref="System.Net.HttpStatusCode.BadRequest"/></value>
32 public System
.Net
.HttpStatusCode HttpStatusCode
{
33 get { return System.Net.HttpStatusCode.BadRequest; }
39 /// Gets or sets a human-readable message indicating why the request failed.
41 [MessagePart("error", IsRequired
= true, AllowEmpty
= true)]
42 internal string ErrorMessage { get; set; }
45 /// Gets or sets the contact address for the administrator of the server.
47 /// <value>The contact address may take any form, as it is intended to be displayed to a person. </value>
48 [MessagePart("contact", IsRequired
= false, AllowEmpty
= true)]
49 internal string Contact { get; set; }
52 /// Gets or sets a reference token, such as a support ticket number or a URL to a news blog, etc.
54 [MessagePart("reference", IsRequired
= false, AllowEmpty
= true)]
55 internal string Reference { get; set; }