This commit is contained in:
Hao Kung 2014-07-16 11:59:03 -07:00
Родитель 214db69b0a
Коммит 54400baed3
2 изменённых файлов: 0 добавлений и 67 удалений

Просмотреть файл

@ -1,43 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Security.Claims;
namespace Microsoft.AspNet.Identity
{
public class ClaimTypeOptions
{
/// <summary>
/// ClaimType used for the security stamp by default
/// </summary>
public static readonly string DefaultSecurityStampClaimType = "AspNet.Identity.SecurityStamp";
public ClaimTypeOptions()
{
Role = ClaimTypes.Role;
SecurityStamp = DefaultSecurityStampClaimType;
UserId = ClaimTypes.NameIdentifier;
UserName = ClaimTypes.Name;
}
/// <summary>
/// Claim type used for role claims
/// </summary>
public string Role { get; set; }
/// <summary>
/// Claim type used for the user name
/// </summary>
public string UserName { get; set; }
/// <summary>
/// Claim type used for the user id
/// </summary>
public string UserId { get; set; }
/// <summary>
/// Claim type used for the user security stamp
/// </summary>
public string SecurityStamp { get; set; }
}
}

Просмотреть файл

@ -1,24 +0,0 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.EntityFramework.InMemory.Test;
using Microsoft.Data.Entity;
using Microsoft.Framework.DependencyInjection;
namespace Microsoft.AspNet.Identity
{
public static class EntityIdentityBuilderExtensions
{
public static IdentityBuilder<TUser, TRole> AddEntityFrameworkInMemory<TUser, TRole, TDbContext>(this IdentityBuilder<TUser, TRole> builder)
where TUser : InMemoryUser
where TRole : IdentityRole
where TDbContext : DbContext
{
builder.Services.AddScoped<TDbContext>();
builder.Services.AddScoped<IUserStore<TUser>, InMemoryUserStore<TUser, TDbContext>>();
builder.Services.AddScoped<IRoleStore<TRole>, RoleStore<TRole, TDbContext>>();
return builder;
}
}
}