diff options
Diffstat (limited to 'samples/OAuthServiceProvider')
-rw-r--r-- | samples/OAuthServiceProvider/Code/Client.cs | 17 | ||||
-rw-r--r-- | samples/OAuthServiceProvider/Members/Authorize.aspx.cs | 8 |
2 files changed, 19 insertions, 6 deletions
diff --git a/samples/OAuthServiceProvider/Code/Client.cs b/samples/OAuthServiceProvider/Code/Client.cs index 43e282d..bb4007e 100644 --- a/samples/OAuthServiceProvider/Code/Client.cs +++ b/samples/OAuthServiceProvider/Code/Client.cs @@ -14,12 +14,25 @@ namespace OAuthServiceProvider.Code { public partial class Client : IConsumerDescription { #region IConsumerDescription Members + /// <summary> + /// Gets the client secret. + /// </summary> string IConsumerDescription.Secret { get { return this.ClientSecret; } } - Uri IConsumerDescription.Callback { - get { return string.IsNullOrEmpty(this.Callback) ? null : new Uri(this.Callback); } + /// <summary> + /// Gets the allowed callback URIs that this client has pre-registered with the service provider, if any. + /// </summary> + /// <value> + /// The URIs that user authorization responses may be directed to; must not be <c>null</c>, but may be empty. + /// </value> + /// <remarks> + /// The first element in this list (if any) will be used as the default client redirect URL if the client sends an authorization request without a redirect URL. + /// If the list is empty, any callback is allowed for this client. + /// </remarks> + List<Uri> IConsumerDescription.AllowedCallbacks { + get { return string.IsNullOrEmpty(this.Callback) ? new List<Uri>() : new List<Uri>(new Uri[] { new Uri(this.Callback) }); } } #endregion diff --git a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs b/samples/OAuthServiceProvider/Members/Authorize.aspx.cs index 48a7897..4cb266f 100644 --- a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs +++ b/samples/OAuthServiceProvider/Members/Authorize.aspx.cs @@ -16,15 +16,15 @@ public partial class Authorize2 : System.Web.UI.Page { private static readonly RandomNumberGenerator CryptoRandomDataGenerator = new RNGCryptoServiceProvider(); + private EndUserAuthorizationRequest pendingRequest; + + private Client client; + private string AuthorizationSecret { get { return Session["OAuthAuthorizationSecret"] as string; } set { Session["OAuthAuthorizationSecret"] = value; } } - private EndUserAuthorizationRequest pendingRequest; - - private Client client; - protected void Page_Load(object sender, EventArgs e) { var getRequest = new HttpRequestInfo("GET", this.Request.Url, this.Request.RawUrl, new WebHeaderCollection(), null); this.pendingRequest = Global.AuthorizationServer.ReadAuthorizationRequest(getRequest); |