1
//-----------------------------------------------------------------------
2 // <copyright file="AssociateUnsuccessfulResponse.cs" company="Andrew Arnott">
3 // Copyright (c) Andrew Arnott. All rights reserved.
5 //-----------------------------------------------------------------------
7 namespace DotNetOpenAuth
.OpenId
.Messages
{
8 using System
.Diagnostics
;
9 using System
.Diagnostics
.CodeAnalysis
;
10 using System
.Globalization
;
11 using DotNetOpenAuth
.Messaging
;
14 /// The Provider's response to a Relying Party that requested an association that the Provider does not support.
17 /// This message type described in OpenID 2.0 section 8.2.4.
19 [DebuggerDisplay("OpenID {Version} associate (failed) response")]
20 internal class AssociateUnsuccessfulResponse
: DirectErrorResponse
{
22 /// A hard-coded string indicating an error occurred.
24 /// <value>"unsupported-type" </value>
25 [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification
= "Read by reflection")]
26 [MessagePart("error_code", IsRequired
= true, AllowEmpty
= false)]
27 #pragma warning disable 0414 // read by reflection
28 private readonly string Error
= "unsupported-type";
29 #pragma warning restore 0414
32 /// Initializes a new instance of the <see cref="AssociateUnsuccessfulResponse"/> class.
34 /// <param name="originatingRequest">The originating request.</param>
35 internal AssociateUnsuccessfulResponse(AssociateRequest originatingRequest
)
36 : base(originatingRequest
) {
37 this.ErrorMessage
= string.Format(CultureInfo
.CurrentCulture
, OpenIdStrings
.AssociationOrSessionTypeUnrecognizedOrNotSupported
, originatingRequest
.AssociationType
, originatingRequest
.SessionType
);
41 /// Gets or sets an association type supported by the OP from Section 8.3 (Association Types).
43 [MessagePart("assoc_type", IsRequired
= false, AllowEmpty
= false)]
44 internal string AssociationType { get; set; }
47 /// Gets or sets a valid association session type from Section 8.4 (Association Session Types) that the OP supports.
49 [MessagePart("session_type", IsRequired
= false, AllowEmpty
= false)]
50 internal string SessionType { get; set; }