diff --git a/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationDescription.cs b/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationDescription.cs index 81653dd166..16b2c43247 100644 --- a/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationDescription.cs +++ b/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationDescription.cs @@ -21,22 +21,22 @@ namespace Microsoft.AspNet.Http.Authentication /// public AuthenticationDescription() { - Dictionary = new Dictionary(StringComparer.Ordinal); + Items = new Dictionary(StringComparer.Ordinal); } /// /// Initializes a new instance of the class /// - /// - public AuthenticationDescription([NotNull] IDictionary properties) + /// + public AuthenticationDescription([NotNull] IDictionary items) { - Dictionary = properties; + Items = items; } /// /// Contains metadata about the authentication provider. /// - public IDictionary Dictionary { get; private set; } + public IDictionary Items { get; private set; } /// /// Gets or sets the name used to reference the authentication middleware instance. @@ -44,7 +44,7 @@ namespace Microsoft.AspNet.Http.Authentication public string AuthenticationScheme { get { return GetString(AuthenticationSchemePropertyKey); } - set { Dictionary[AuthenticationSchemePropertyKey] = value; } + set { Items[AuthenticationSchemePropertyKey] = value; } } /// @@ -53,13 +53,13 @@ namespace Microsoft.AspNet.Http.Authentication public string Caption { get { return GetString(CaptionPropertyKey); } - set { Dictionary[CaptionPropertyKey] = value; } + set { Items[CaptionPropertyKey] = value; } } private string GetString(string name) { object value; - if (Dictionary.TryGetValue(name, out value)) + if (Items.TryGetValue(name, out value)) { return Convert.ToString(value, CultureInfo.InvariantCulture); } diff --git a/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationProperties.cs b/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationProperties.cs index 475dd027d9..f6574163c7 100644 --- a/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationProperties.cs +++ b/src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationProperties.cs @@ -24,51 +24,51 @@ namespace Microsoft.AspNet.Http.Authentication /// Initializes a new instance of the class /// public AuthenticationProperties() - : this(dictionary: null) + : this(items: null) { } /// /// Initializes a new instance of the class /// - /// - public AuthenticationProperties(IDictionary dictionary) + /// + public AuthenticationProperties(IDictionary items) { - Dictionary = dictionary ?? new Dictionary(StringComparer.Ordinal); + Items = items ?? new Dictionary(StringComparer.Ordinal); } /// /// State values about the authentication session. /// - public IDictionary Dictionary { get; private set; } + public IDictionary Items { get; private set; } /// /// Gets or sets whether the authentication session is persisted across multiple requests. /// public bool IsPersistent { - get { return Dictionary.ContainsKey(IsPersistentKey); } + get { return Items.ContainsKey(IsPersistentKey); } set { - if (Dictionary.ContainsKey(IsPersistentKey)) + if (Items.ContainsKey(IsPersistentKey)) { if (!value) { - Dictionary.Remove(IsPersistentKey); + Items.Remove(IsPersistentKey); } } else { if (value) { - Dictionary.Add(IsPersistentKey, string.Empty); + Items.Add(IsPersistentKey, string.Empty); } } } } /// - /// Gets or sets the full path or absolute URI to be used as an http redirect response value. + /// Gets or sets the full path or absolute URI to be used as an http redirect response value. /// [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "By design")] public string RedirectUri @@ -76,19 +76,19 @@ namespace Microsoft.AspNet.Http.Authentication get { string value; - return Dictionary.TryGetValue(RedirectUriKey, out value) ? value : null; + return Items.TryGetValue(RedirectUriKey, out value) ? value : null; } set { if (value != null) { - Dictionary[RedirectUriKey] = value; + Items[RedirectUriKey] = value; } else { - if (Dictionary.ContainsKey(RedirectUriKey)) + if (Items.ContainsKey(RedirectUriKey)) { - Dictionary.Remove(RedirectUriKey); + Items.Remove(RedirectUriKey); } } } @@ -102,7 +102,7 @@ namespace Microsoft.AspNet.Http.Authentication get { string value; - if (Dictionary.TryGetValue(IssuedUtcKey, out value)) + if (Items.TryGetValue(IssuedUtcKey, out value)) { DateTimeOffset dateTimeOffset; if (DateTimeOffset.TryParseExact(value, UtcDateTimeFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTimeOffset)) @@ -116,13 +116,13 @@ namespace Microsoft.AspNet.Http.Authentication { if (value.HasValue) { - Dictionary[IssuedUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture); + Items[IssuedUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture); } else { - if (Dictionary.ContainsKey(IssuedUtcKey)) + if (Items.ContainsKey(IssuedUtcKey)) { - Dictionary.Remove(IssuedUtcKey); + Items.Remove(IssuedUtcKey); } } } @@ -136,7 +136,7 @@ namespace Microsoft.AspNet.Http.Authentication get { string value; - if (Dictionary.TryGetValue(ExpiresUtcKey, out value)) + if (Items.TryGetValue(ExpiresUtcKey, out value)) { DateTimeOffset dateTimeOffset; if (DateTimeOffset.TryParseExact(value, UtcDateTimeFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTimeOffset)) @@ -150,13 +150,13 @@ namespace Microsoft.AspNet.Http.Authentication { if (value.HasValue) { - Dictionary[ExpiresUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture); + Items[ExpiresUtcKey] = value.Value.ToString(UtcDateTimeFormat, CultureInfo.InvariantCulture); } else { - if (Dictionary.ContainsKey(ExpiresUtcKey)) + if (Items.ContainsKey(ExpiresUtcKey)) { - Dictionary.Remove(ExpiresUtcKey); + Items.Remove(ExpiresUtcKey); } } } @@ -170,7 +170,7 @@ namespace Microsoft.AspNet.Http.Authentication get { string value; - if (Dictionary.TryGetValue(RefreshKey, out value)) + if (Items.TryGetValue(RefreshKey, out value)) { bool refresh; if (bool.TryParse(value, out refresh)) @@ -184,13 +184,13 @@ namespace Microsoft.AspNet.Http.Authentication { if (value.HasValue) { - Dictionary[RefreshKey] = value.Value.ToString(); + Items[RefreshKey] = value.Value.ToString(); } else { - if (Dictionary.ContainsKey(RefreshKey)) + if (Items.ContainsKey(RefreshKey)) { - Dictionary.Remove(RefreshKey); + Items.Remove(RefreshKey); } } } diff --git a/src/Microsoft.AspNet.Http/Authentication/DefaultAuthenticationManager.cs b/src/Microsoft.AspNet.Http/Authentication/DefaultAuthenticationManager.cs index 76369f246d..9fccca6116 100644 --- a/src/Microsoft.AspNet.Http/Authentication/DefaultAuthenticationManager.cs +++ b/src/Microsoft.AspNet.Http/Authentication/DefaultAuthenticationManager.cs @@ -87,7 +87,7 @@ namespace Microsoft.AspNet.Http.Authentication HttpResponseFeature.StatusCode = 401; var handler = HttpAuthenticationFeature.Handler; - var challengeContext = new ChallengeContext(authenticationScheme, properties == null ? null : properties.Dictionary); + var challengeContext = new ChallengeContext(authenticationScheme, properties == null ? null : properties.Items); if (handler != null) { handler.Challenge(challengeContext); @@ -103,7 +103,7 @@ namespace Microsoft.AspNet.Http.Authentication { var handler = HttpAuthenticationFeature.Handler; - var signInContext = new SignInContext(authenticationScheme, principal, properties == null ? null : properties.Dictionary); + var signInContext = new SignInContext(authenticationScheme, principal, properties == null ? null : properties.Items); if (handler != null) { handler.SignIn(signInContext); @@ -120,7 +120,7 @@ namespace Microsoft.AspNet.Http.Authentication { var handler = HttpAuthenticationFeature.Handler; - var signOutContext = new SignOutContext(authenticationScheme, properties?.Dictionary); + var signOutContext = new SignOutContext(authenticationScheme, properties?.Items); if (handler != null) { handler.SignOut(signOutContext);