//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace RelyingPartyLogic { using System; using System.Collections.Generic; using DotNetOpenAuth.OAuth2; public partial class Client : IConsumerDescription { #region IConsumerDescription Members /// /// Gets the client secret. /// string IConsumerDescription.Secret { get { return this.ClientSecret; } } /// /// Gets the callback to use when an individual authorization request /// does not include an explicit callback URI. /// /// /// An absolute URL; or null if none is registered. /// Uri IConsumerDescription.DefaultCallback { get { return string.IsNullOrEmpty(this.CallbackAsString) ? null : new Uri(this.CallbackAsString); } } /// /// Determines whether a callback URI included in a client's authorization request /// is among those allowed callbacks for the registered client. /// /// The absolute URI the client has requested the authorization result be received at. /// /// true if the callback URL is allowable for this client; otherwise, false. /// bool IConsumerDescription.IsCallbackAllowed(Uri callback) { return string.IsNullOrEmpty(this.CallbackAsString) || callback == new Uri(this.CallbackAsString); } #endregion } }