//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OpenId.Messages {
using System;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Reflection;
///
/// Represents an association request that is sent using HTTPS and otherwise communicates the shared secret in plain text.
///
internal class AssociateUnencryptedRequest : AssociateRequest {
///
/// Initializes a new instance of the class.
///
/// The OpenID version this message must comply with.
/// The OpenID Provider endpoint.
internal AssociateUnencryptedRequest(Version version, Uri providerEndpoint)
: base(version, providerEndpoint) {
SessionType = Protocol.Args.SessionType.NoEncryption;
}
///
/// Checks the message state for conformity to the protocol specification
/// and throws an exception if the message is invalid.
///
///
/// Some messages have required fields, or combinations of fields that must relate to each other
/// in specialized ways. After deserializing a message, this method checks the state of the
/// message to see if it conforms to the protocol.
/// Note that this property should not check signatures or perform any state checks
/// outside this scope of this particular message.
///
/// Thrown if the message is invalid.
public override void EnsureValidMessage() {
base.EnsureValidMessage();
ErrorUtilities.VerifyProtocol(
string.Equals(this.SessionType, Protocol.Args.SessionType.NoEncryption, StringComparison.Ordinal),
MessagingStrings.UnexpectedMessagePartValueForConstant,
GetType().Name,
Protocol.openid.session_type,
Protocol.Args.SessionType.NoEncryption,
SessionType);
}
}
}