//----------------------------------------------------------------------- // // Copyright (c) Andrew Arnott. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId.Provider { using System; using System.Diagnostics.Contracts; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OpenId.Messages; /// /// Interface exposing incoming messages to the OpenID Provider that /// require interaction with the host site. /// [ContractClass(typeof(IHostProcessedRequestContract))] public interface IHostProcessedRequest : IRequest { /// /// Gets the version of OpenID being used by the relying party that sent the request. /// ProtocolVersion RelyingPartyVersion { get; } /// /// Gets the URL the consumer site claims to use as its 'base' address. /// Realm Realm { get; } /// /// Gets a value indicating whether the consumer demands an immediate response. /// If false, the consumer is willing to wait for the identity provider /// to authenticate the user. /// bool Immediate { get; } /// /// Gets or sets the provider endpoint claimed in the positive assertion. /// /// /// The default value is the URL that the request came in on from the relying party. /// This value MUST match the value for the OP Endpoint in the discovery results for the /// claimed identifier being asserted in a positive response. /// Uri ProviderEndpoint { get; set; } /// /// Attempts to perform relying party discovery of the return URL claimed by the Relying Party. /// /// The OpenIdProvider that is performing the RP discovery. /// /// The details of how successful the relying party discovery was. /// /// /// Return URL verification is only attempted if this method is called. /// See OpenID Authentication 2.0 spec section 9.2.1. /// RelyingPartyDiscoveryResult IsReturnUrlDiscoverable(OpenIdProvider provider); } /// /// Code contract for the type. /// [ContractClassFor(typeof(IHostProcessedRequest))] internal abstract class IHostProcessedRequestContract : IHostProcessedRequest { /// /// Initializes a new instance of the class. /// protected IHostProcessedRequestContract() { } #region IHostProcessedRequest Properties /// /// Gets the version of OpenID being used by the relying party that sent the request. /// ProtocolVersion IHostProcessedRequest.RelyingPartyVersion { get { throw new System.NotImplementedException(); } } /// /// Gets the URL the consumer site claims to use as its 'base' address. /// Realm IHostProcessedRequest.Realm { get { throw new System.NotImplementedException(); } } /// /// Gets a value indicating whether the consumer demands an immediate response. /// If false, the consumer is willing to wait for the identity provider /// to authenticate the user. /// bool IHostProcessedRequest.Immediate { get { throw new System.NotImplementedException(); } } /// /// Gets or sets the provider endpoint. /// /// /// The default value is the URL that the request came in on from the relying party. /// Uri IHostProcessedRequest.ProviderEndpoint { get { Contract.Ensures(Contract.Result() != null); throw new NotImplementedException(); } set { Contract.Requires(value != null); throw new NotImplementedException(); } } #endregion #region IRequest Members /// /// Gets or sets the security settings that apply to this request. /// /// /// Defaults to the on the . /// ProviderSecuritySettings IRequest.SecuritySettings { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } /// /// Gets a value indicating whether the response is ready to be sent to the user agent. /// /// /// This property returns false if there are properties that must be set on this /// request instance before the response can be sent. /// bool IRequest.IsResponseReady { get { throw new System.NotImplementedException(); } } /// /// Adds an extension to the response to send to the relying party. /// /// The extension to add to the response message. void IRequest.AddResponseExtension(DotNetOpenAuth.OpenId.Messages.IOpenIdMessageExtension extension) { throw new System.NotImplementedException(); } /// /// Removes any response extensions previously added using . /// /// /// This should be called before sending a negative response back to the relying party /// if extensions were already added, since negative responses cannot carry extensions. /// void IRequest.ClearResponseExtensions() { } /// /// Gets an extension sent from the relying party. /// /// The type of the extension. /// /// An instance of the extension initialized with values passed in with the request. /// T IRequest.GetExtension() { throw new System.NotImplementedException(); } /// /// Gets an extension sent from the relying party. /// /// The type of the extension. /// /// An instance of the extension initialized with values passed in with the request. /// DotNetOpenAuth.OpenId.Messages.IOpenIdMessageExtension IRequest.GetExtension(System.Type extensionType) { throw new System.NotImplementedException(); } #endregion #region IHostProcessedRequest Methods /// /// Attempts to perform relying party discovery of the return URL claimed by the Relying Party. /// /// The OpenIdProvider that is performing the RP discovery. /// /// The details of how successful the relying party discovery was. /// /// /// Return URL verification is only attempted if this method is called. /// See OpenID Authentication 2.0 spec section 9.2.1. /// RelyingPartyDiscoveryResult IHostProcessedRequest.IsReturnUrlDiscoverable(OpenIdProvider provider) { Contract.Requires(provider != null); throw new System.NotImplementedException(); } #endregion } }