diff options
-rw-r--r-- | samples/OAuthConsumer/Global.asax.cs | 3 | ||||
-rw-r--r-- | samples/OAuthConsumer/GoogleAddressBook.aspx.cs | 4 | ||||
-rw-r--r-- | samples/OAuthConsumer/SampleWcf.aspx.cs | 16 | ||||
-rw-r--r-- | samples/OAuthConsumer/SignInWithTwitter.aspx.cs | 2 | ||||
-rw-r--r-- | samples/OAuthConsumer/Twitter.aspx.cs | 12 | ||||
-rw-r--r-- | samples/OAuthServiceProvider/Default.aspx.cs | 11 | ||||
-rw-r--r-- | samples/OAuthServiceProvider/Members/Authorize.aspx.cs | 8 | ||||
-rw-r--r-- | src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs | 3 |
8 files changed, 29 insertions, 30 deletions
diff --git a/samples/OAuthConsumer/Global.asax.cs b/samples/OAuthConsumer/Global.asax.cs index b2f5b5a..10f297e 100644 --- a/samples/OAuthConsumer/Global.asax.cs +++ b/samples/OAuthConsumer/Global.asax.cs @@ -12,6 +12,7 @@ protected void Application_End(object sender, EventArgs e) { Logging.Logger.Info("Sample shutting down..."); + // this would be automatic, but in partial trust scenarios it is not. log4net.LogManager.Shutdown(); } @@ -22,7 +23,6 @@ protected void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started - } protected void Session_End(object sender, EventArgs e) { @@ -30,7 +30,6 @@ // Note: The Session_End event is raised only when the sessionstate mode // is set to InProc in the Web.config file. If session mode is set to StateServer // or SQLServer, the event is not raised. - } } }
\ No newline at end of file diff --git a/samples/OAuthConsumer/GoogleAddressBook.aspx.cs b/samples/OAuthConsumer/GoogleAddressBook.aspx.cs index 825dd1a..808065f 100644 --- a/samples/OAuthConsumer/GoogleAddressBook.aspx.cs +++ b/samples/OAuthConsumer/GoogleAddressBook.aspx.cs @@ -37,7 +37,7 @@ protected void Page_Load(object sender, EventArgs e) { if (this.TokenManager != null) { - MultiView1.ActiveViewIndex = 1; + this.MultiView1.ActiveViewIndex = 1; if (!IsPostBack) { var google = new WebConsumer(GoogleConsumer.ServiceDescription, this.TokenManager); @@ -69,7 +69,7 @@ HttpUtility.HtmlEncode(contact.Email)); } tableBuilder.Append("</table>"); - resultsPlaceholder.Controls.Add(new Literal { Text = tableBuilder.ToString() }); + this.resultsPlaceholder.Controls.Add(new Literal { Text = tableBuilder.ToString() }); } } }
\ No newline at end of file diff --git a/samples/OAuthConsumer/SampleWcf.aspx.cs b/samples/OAuthConsumer/SampleWcf.aspx.cs index 4055c6c..489e294 100644 --- a/samples/OAuthConsumer/SampleWcf.aspx.cs +++ b/samples/OAuthConsumer/SampleWcf.aspx.cs @@ -26,7 +26,7 @@ var accessTokenMessage = consumer.ProcessUserAuthorization(); if (accessTokenMessage != null) { Session["WcfAccessToken"] = accessTokenMessage.AccessToken; - authorizationLabel.Text = "Authorized! Access token: " + accessTokenMessage.AccessToken; + this.authorizationLabel.Text = "Authorized! Access token: " + accessTokenMessage.AccessToken; } } } @@ -36,7 +36,7 @@ WebConsumer consumer = this.CreateConsumer(); UriBuilder callback = new UriBuilder(Request.Url); callback.Query = null; - string[] scopes = (from item in scopeList.Items.OfType<ListItem>() + string[] scopes = (from item in this.scopeList.Items.OfType<ListItem>() where item.Selected select item.Value).ToArray(); string scope = string.Join("|", scopes); @@ -49,27 +49,27 @@ protected void getNameButton_Click(object sender, EventArgs e) { try { - nameLabel.Text = CallService(client => client.GetName()); + this.nameLabel.Text = CallService(client => client.GetName()); } catch (SecurityAccessDeniedException) { - nameLabel.Text = "Access denied!"; + this.nameLabel.Text = "Access denied!"; } } protected void getAgeButton_Click(object sender, EventArgs e) { try { int? age = CallService(client => client.GetAge()); - ageLabel.Text = age.HasValue ? age.Value.ToString(CultureInfo.CurrentCulture) : "not available"; + this.ageLabel.Text = age.HasValue ? age.Value.ToString(CultureInfo.CurrentCulture) : "not available"; } catch (SecurityAccessDeniedException) { - ageLabel.Text = "Access denied!"; + this.ageLabel.Text = "Access denied!"; } } protected void getFavoriteSites_Click(object sender, EventArgs e) { try { string[] favoriteSites = CallService(client => client.GetFavoriteSites()); - favoriteSitesLabel.Text = string.Join(", ", favoriteSites); + this.favoriteSitesLabel.Text = string.Join(", ", favoriteSites); } catch (SecurityAccessDeniedException) { - favoriteSitesLabel.Text = "Access denied!"; + this.favoriteSitesLabel.Text = "Access denied!"; } } diff --git a/samples/OAuthConsumer/SignInWithTwitter.aspx.cs b/samples/OAuthConsumer/SignInWithTwitter.aspx.cs index 9cea1f5..26ccead 100644 --- a/samples/OAuthConsumer/SignInWithTwitter.aspx.cs +++ b/samples/OAuthConsumer/SignInWithTwitter.aspx.cs @@ -15,7 +15,7 @@ public partial class SignInWithTwitter : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (TwitterConsumer.IsTwitterConsumerConfigured) { - MultiView1.ActiveViewIndex = 1; + this.MultiView1.ActiveViewIndex = 1; if (!IsPostBack) { string screenName; diff --git a/samples/OAuthConsumer/Twitter.aspx.cs b/samples/OAuthConsumer/Twitter.aspx.cs index 44350ca..12450e6 100644 --- a/samples/OAuthConsumer/Twitter.aspx.cs +++ b/samples/OAuthConsumer/Twitter.aspx.cs @@ -36,7 +36,7 @@ protected void Page_Load(object sender, EventArgs e) { if (this.TokenManager != null) { - MultiView1.ActiveViewIndex = 1; + this.MultiView1.ActiveViewIndex = 1; if (!IsPostBack) { var twitter = new WebConsumer(TwitterConsumer.ServiceDescription, this.TokenManager); @@ -79,8 +79,8 @@ protected void uploadProfilePhotoButton_Click(object sender, EventArgs e) { if (profilePhoto.PostedFile.ContentType == null) { - photoUploadedLabel.Visible = true; - photoUploadedLabel.Text = "Select a file first."; + this.photoUploadedLabel.Visible = true; + this.photoUploadedLabel.Text = "Select a file first."; return; } @@ -88,9 +88,9 @@ XDocument imageResult = TwitterConsumer.UpdateProfileImage( twitter, this.AccessToken, - profilePhoto.PostedFile.InputStream, - profilePhoto.PostedFile.ContentType); - photoUploadedLabel.Visible = true; + this.profilePhoto.PostedFile.InputStream, + this.profilePhoto.PostedFile.ContentType); + this.photoUploadedLabel.Visible = true; } } }
\ No newline at end of file diff --git a/samples/OAuthServiceProvider/Default.aspx.cs b/samples/OAuthServiceProvider/Default.aspx.cs index a08a2d2..653046a 100644 --- a/samples/OAuthServiceProvider/Default.aspx.cs +++ b/samples/OAuthServiceProvider/Default.aspx.cs @@ -9,17 +9,18 @@ public partial class _Default : System.Web.UI.Page { protected void createDatabaseButton_Click(object sender, EventArgs e) { - string dbPath = Path.Combine(Server.MapPath(Request.ApplicationPath), "App_Data"); - if (!Directory.Exists(dbPath)) { - Directory.CreateDirectory(dbPath); + string databasePath = Path.Combine(Server.MapPath(Request.ApplicationPath), "App_Data"); + if (!Directory.Exists(databasePath)) { + Directory.CreateDirectory(databasePath); } - string connectionString = ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString.Replace("|DataDirectory|", dbPath); + string connectionString = ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString.Replace("|DataDirectory|", databasePath); var dc = new DataClassesDataContext(connectionString); if (dc.DatabaseExists()) { dc.DeleteDatabase(); } try { dc.CreateDatabase(); + // Fill with sample data. dc.OAuthConsumers.InsertOnSubmit(new OAuthConsumer { ConsumerKey = "sampleconsumer", @@ -37,7 +38,7 @@ }); dc.SubmitChanges(); - databaseStatus.Visible = true; + this.databaseStatus.Visible = true; } catch (System.Data.SqlClient.SqlException ex) { foreach (System.Data.SqlClient.SqlError error in ex.Errors) { Response.Write(error.Message); diff --git a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs b/samples/OAuthServiceProvider/Members/Authorize.aspx.cs index ec98ddf..4625949 100644 --- a/samples/OAuthServiceProvider/Members/Authorize.aspx.cs +++ b/samples/OAuthServiceProvider/Members/Authorize.aspx.cs @@ -38,15 +38,15 @@ byte[] randomData = new byte[8]; CryptoRandomDataGenerator.GetBytes(randomData); this.AuthorizationSecret = Convert.ToBase64String(randomData); - OAuthAuthorizationSecToken.Value = this.AuthorizationSecret; + this.OAuthAuthorizationSecToken.Value = this.AuthorizationSecret; - OAuth10ConsumerWarning.Visible = Global.PendingOAuthAuthorization.IsUnsafeRequest; + this.OAuth10ConsumerWarning.Visible = Global.PendingOAuthAuthorization.IsUnsafeRequest; } } } protected void allowAccessButton_Click(object sender, EventArgs e) { - if (this.AuthorizationSecret != OAuthAuthorizationSecToken.Value) { + if (this.AuthorizationSecret != this.OAuthAuthorizationSecToken.Value) { throw new ArgumentException(); // probably someone trying to hack in. } this.AuthorizationSecret = null; // clear one time use secret @@ -74,7 +74,7 @@ protected void denyAccessButton_Click(object sender, EventArgs e) { // erase the request token. - multiView.ActiveViewIndex = 2; + this.multiView.ActiveViewIndex = 2; } } }
\ No newline at end of file diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs index 77d8ae1..09383bb 100644 --- a/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs +++ b/src/DotNetOpenAuth/OpenId/RelyingParty/AuthenticationRequest.cs @@ -4,8 +4,6 @@ // </copyright> //----------------------------------------------------------------------- -using System.Threading; - namespace DotNetOpenAuth.OpenId.RelyingParty { using System; using System.Collections.Generic; @@ -13,6 +11,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty { using System.Diagnostics.Contracts; using System.Linq; using System.Text; + using System.Threading; using System.Web; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OpenId.ChannelElements; |