//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OpenId.Messages {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.ChannelElements;
///
/// The message sent from the Provider to the Relying Party to confirm/deny
/// the validity of an assertion that was signed by a private Provider secret.
///
internal class CheckAuthenticationResponse : DirectResponseBase {
///
/// Initializes a new instance of the class
/// for use by the Relying Party.
///
/// The OpenID version of the response message.
/// The request that this message is responding to.
internal CheckAuthenticationResponse(Version responseVersion, CheckAuthenticationRequest request)
: base(responseVersion, request) {
}
///
/// Gets or sets a value indicating whether the signature of the verification request is valid.
///
[MessagePart("is_valid", IsRequired = true)]
internal bool IsValid { get; set; }
///
/// Gets or sets the handle the relying party should invalidate if is true.
///
/// The "invalidate_handle" value sent in the verification request, if the OP confirms it is invalid.
///
/// If present in a verification response with "is_valid" set to "true",
/// the Relying Party SHOULD remove the corresponding association from
/// its store and SHOULD NOT send further authentication requests with
/// this handle.
/// This two-step process for invalidating associations is necessary
/// to prevent an attacker from invalidating an association at will by
/// adding "invalidate_handle" parameters to an authentication response.
/// For OpenID 1.1, we allow this to be present but empty to put up with poor implementations such as Blogger.
///
[MessagePart("invalidate_handle", IsRequired = false, AllowEmpty = true, MaxVersion = "1.1")]
[MessagePart("invalidate_handle", IsRequired = false, AllowEmpty = false, MinVersion = "2.0")]
internal string InvalidateHandle { get; set; }
}
}