//-----------------------------------------------------------------------
//
// Copyright (c) Andrew Arnott. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOAuth {
using System;
using DotNetOAuth.ChannelElements;
using DotNetOAuth.Messaging;
///
/// A description of the endpoints on a Service Provider.
///
public class ServiceProviderDescription {
///
/// The field used to store the value of the property.
///
private MessageReceivingEndpoint requestTokenEndpoint;
///
/// Initializes a new instance of the class.
///
public ServiceProviderDescription() {
}
///
/// Gets or sets the URL used to obtain an unauthorized Request Token,
/// described in Section 6.1 (Obtaining an Unauthorized Request Token).
///
///
/// The request URL query MUST NOT contain any OAuth Protocol Parameters.
/// This is the URL that messages are directed to.
///
/// Thrown if this property is set to a URI with OAuth protocol parameters.
public MessageReceivingEndpoint RequestTokenEndpoint {
get {
return this.requestTokenEndpoint;
}
set {
if (value != null && UriUtil.QueryStringContainsOAuthParameters(value.Location)) {
throw new ArgumentException(Strings.RequestUrlMustNotHaveOAuthParameters);
}
this.requestTokenEndpoint = value;
}
}
///
/// Gets or sets the URL used to obtain User authorization for Consumer access,
/// described in Section 6.2 (Obtaining User Authorization).
///
///
/// This is the URL that messages are
/// indirectly (via the user agent) sent to.
///
public MessageReceivingEndpoint UserAuthorizationEndpoint { get; set; }
///
/// Gets or sets the URL used to exchange the User-authorized Request Token
/// for an Access Token, described in Section 6.3 (Obtaining an Access Token).
///
///
/// This is the URL that messages are directed to.
///
public MessageReceivingEndpoint AccessTokenEndpoint { get; set; }
///
/// Gets or sets the signing policies that apply to this Service Provider.
///
public ITamperProtectionChannelBindingElement[] TamperProtectionElements { get; set; }
///
/// Creates a signing element that includes all the signing elements this service provider supports.
///
/// The created signing element.
internal ITamperProtectionChannelBindingElement CreateTamperProtectionElement() {
return new SigningBindingElementChain(this.TamperProtectionElements);
}
}
}