From e76d1c280964af429e61181c0ab75f337da21e1c Mon Sep 17 00:00:00 2001 From: Barry Dorrans Date: Wed, 7 Jan 2015 12:28:35 -0800 Subject: [PATCH] XMLDoc updates. --- .../BuilderExtensions.cs | 1 + .../ClaimsIdentityFactory.cs | 49 +++++++++++++++---- .../ClaimsIdentityOptions.cs | 26 ++++++++-- 3 files changed, 62 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.AspNet.Identity/BuilderExtensions.cs b/src/Microsoft.AspNet.Identity/BuilderExtensions.cs index 13b2df4b91..d4d184e759 100644 --- a/src/Microsoft.AspNet.Identity/BuilderExtensions.cs +++ b/src/Microsoft.AspNet.Identity/BuilderExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; + using Microsoft.AspNet.Identity; namespace Microsoft.AspNet.Builder diff --git a/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs b/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs index 9fc5cb760f..bda8839ac8 100644 --- a/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs +++ b/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs @@ -5,19 +5,29 @@ using System; using System.Security.Claims; using System.Threading; using System.Threading.Tasks; + using Microsoft.Framework.OptionsModel; namespace Microsoft.AspNet.Identity { /// - /// Creates a ClaimsIdentity from a User + /// Provides methods to create a claims identity for a given user. /// - /// + /// The type used to represent a user. + /// The type used to represent a role. public class ClaimsIdentityFactory : IClaimsIdentityFactory where TUser : class where TRole : class { - public ClaimsIdentityFactory(UserManager userManager, RoleManager roleManager, + /// + /// Initializes a new instance of the class. + /// + /// The to retrieve user information from. + /// The to retrieve a user's roles from. + /// The configured . + public ClaimsIdentityFactory( + UserManager userManager, + RoleManager roleManager, IOptions optionsAccessor) { if (userManager == null) @@ -37,19 +47,38 @@ namespace Microsoft.AspNet.Identity Options = optionsAccessor.Options; } + /// + /// Gets the for this factory. + /// + /// + /// The current for this factory instance. + /// public UserManager UserManager { get; private set; } + + /// + /// Gets the for this factory. + /// + /// + /// The current for this factory instance. + /// public RoleManager RoleManager { get; private set; } + + /// + /// Gets the for this factory. + /// + /// + /// The current for this factory instance. + /// public IdentityOptions Options { get; private set; } /// - /// CreateAsync a ClaimsIdentity from a user + /// Creates a populated for the specified . /// - /// - /// - /// - /// - /// - public virtual async Task CreateAsync(TUser user, + /// The user instance to create claims on. + /// A to observe while waiting for the tasks to complete. + /// A that represents the started task. + public virtual async Task CreateAsync( + TUser user, CancellationToken cancellationToken = default(CancellationToken)) { if (user == null) diff --git a/src/Microsoft.AspNet.Identity/ClaimsIdentityOptions.cs b/src/Microsoft.AspNet.Identity/ClaimsIdentityOptions.cs index 9b8dd3c24f..be0df88958 100644 --- a/src/Microsoft.AspNet.Identity/ClaimsIdentityOptions.cs +++ b/src/Microsoft.AspNet.Identity/ClaimsIdentityOptions.cs @@ -5,28 +5,46 @@ using System.Security.Claims; namespace Microsoft.AspNet.Identity { + /// + /// Options for ClaimType names. + /// public class ClaimsIdentityOptions { + /// + /// The ClaimType used for the identity security stamp. + /// public static readonly string DefaultSecurityStampClaimType = "AspNet.Identity.SecurityStamp"; /// - /// Claim type used for role claims + /// Gets the ClaimType used for a Role claim. /// + /// + /// This defaults to . + /// public string RoleClaimType { get; set; } = ClaimTypes.Role; /// - /// Claim type used for the user name + /// Gets the ClaimType used for the user name claim. /// + /// + /// This defaults to . + /// public string UserNameClaimType { get; set; } = ClaimTypes.Name; /// - /// Claim type used for the user id + /// Gets the ClaimType used for the user identifier claim. /// + /// + /// This defaults to . + /// public string UserIdClaimType { get; set; } = ClaimTypes.NameIdentifier; /// - /// Claim type used for the user security stamp + /// Gets the ClaimType used for the security stamp claim.. /// + /// + /// This defaults to "AspNet.Identity.SecurityStamp". + /// public string SecurityStampClaimType { get; set; } = DefaultSecurityStampClaimType; } } \ No newline at end of file