コード例 #1
0
 public SqlServerApiResourceStore(IIdentityDbContext identityDbContext,
                                  IEventService eventService,
                                  IUserResolverService userResolverService,
                                  ISerializationSettings serializationSettings)
     : base(identityDbContext, eventService, userResolverService, serializationSettings)
 {
 }
コード例 #2
0
        public async Task InitializeAsync()
        {
            MongoResource = new MongoResource();
            await MongoResource.InitializeAsync();

            Database = MongoResource.CreateDatabase();

            IWebHostBuilder hostBuilder = new WebHostBuilder()
                                          .ConfigureAppConfiguration(builder =>
            {
                builder.SetBasePath(Directory.GetCurrentDirectory());
                builder.AddJsonFile("appsettings.test.json", optional: true);
                builder.AddInMemoryCollection(new Dictionary <string, string>
                {
                    ["Identity:Database:ConnectionString"] =
                        MongoResource.ConnectionString,
                    ["Identity:Database:DatabaseName"] =
                        Database.DatabaseNamespace.DatabaseName
                });
            })
                                          .ConfigureTestServices(services =>
            {
            })
                                          .UseStartup <Startup>();

            var server = new TestServer(hostBuilder);

            Services = server.Services;

            IIdentityDbContext dbContext = server.Services.GetService <IIdentityDbContext>();

            var seeder = new DataSeeder(dbContext);
            await seeder.SeedIntialDataAsync(default);
コード例 #3
0
 /// <summary>
 ///     Creates a new instance of the <see cref="UserStore{TUser}"/>
 ///     class using the provided <see cref="IIdentityDbContext"/>.
 /// </summary>
 /// <param name="dbContext">The <see cref="IIdentityDbContext"/> to use.</param>
 public UserStore(IIdentityDbContext dbContext)
     : this(new UsersTable <TUser>(dbContext),
            new RolesTable <IdentityRole>(dbContext),
            new UserRolesTable(dbContext),
            new UserClaimsTable(dbContext),
            new UserLoginsTable(dbContext))
 {
 }
コード例 #4
0
 public SqlServerPersistedGrantStore(IIdentityDbContext identityDbContext,
                                     ILogger logger,
                                     IEventService eventService,
                                     IUserResolverService userResolverService,
                                     ISerializationSettings serializationSettings) : base(identityDbContext, eventService, userResolverService, serializationSettings)
 {
     _logger = logger;
 }
コード例 #5
0
        /// <summary>
        ///     Creates a new instance of the <see cref="Table"/>
        ///     class with the specified <see cref="IIdentityDbContext"/>.
        /// </summary>
        /// <param name="dbContext">
        ///     Instance of <see cref="IIdentityDbContext"/> to use when interacting with the database.
        /// </param>
        /// <exception cref="ArgumentNullException">
        ///     Thrown if the <paramref name="dbContext"/> parameter is <c>null</c>.
        /// </exception>
        protected internal Table(IIdentityDbContext dbContext)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException(nameof(dbContext));
            }

            this.dbContext = dbContext;
        }
コード例 #6
0
 public SignUpService(
     ISmsService smsService,
     ITotpCodeService totpCodeService,
     IIdentityDbContext identityDbContext)
 {
     _smsService        = smsService;
     _totpCodeService   = totpCodeService;
     _identityDbContext = identityDbContext;
 }
コード例 #7
0
 protected SqlServerBaseStore(IIdentityDbContext identityDbContext,
                              IEventService eventService,
                              IUserResolverService userResolverService,
                              ISerializationSettings serializationSettings)
 {
     IdentityDbContext     = identityDbContext;
     EventService          = eventService;
     UserResolverService   = userResolverService;
     SerializationSettings = serializationSettings;
 }
コード例 #8
0
        private async Task <SignUpSession> GetSessionAsync(string email)
        {
            IIdentityDbContext db = _testContext.GetDbContext();

            SignUpSession session = await db.SignUpSessions.AsQueryable()
                                    .Where(x => x.Email == email)
                                    .FirstOrDefaultAsync();

            return(session);
        }
コード例 #9
0
 public SeedDataCommandHandler(
     IIdentityDbContext identityDbContext,
     IAppDbContext dbContext,
     ISecurityUserManager securityUserManager,
     IUserRepository userRepo,
     IDbRunTimeConfig dbRunTimeConfig)
 {
     _identityDbContext   = identityDbContext;
     _dbContext           = dbContext;
     _securityUserManager = securityUserManager;
     _userRepo            = userRepo;
     _dbRunTimeConfig     = dbRunTimeConfig;
 }
コード例 #10
0
        public ApplicationUserService(IIdentityDbContext userContext, IPizzaFactoryDbContext pizzaContext, IOrderDbContext orderContext, IMapper mapper, IValidator validator)
        {
            Guard.WhenArgument(userContext, nameof(userContext)).IsNull().Throw();
            Guard.WhenArgument(pizzaContext, nameof(pizzaContext)).IsNull().Throw();
            Guard.WhenArgument(orderContext, nameof(orderContext)).IsNull().Throw();
            Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw();
            Guard.WhenArgument(validator, nameof(validator)).IsNull().Throw();

            this.userContext  = userContext;
            this.pizzaContext = pizzaContext;
            this.orderContext = orderContext;
            this.mapper       = mapper;
            this.validator    = validator;
        }
コード例 #11
0
        /// <summary>
        ///     Checks the given instance of <see cref="IIdentityDbContext"/> to see whether the specified instance of
        ///     <see cref="ITableCommands"/> is <c>null</c>; if so, an <see cref="ArgumentException"/> is thrown.
        /// </summary>
        /// <param name="dbContext"></param>
        /// <param name="propertyToCheck"></param>
        protected static void ThrowIfTableCommandsIsNull(IIdentityDbContext dbContext, Func <IIdentityDbContext, ITableCommands> propertyToCheck)
        {
            if (propertyToCheck == null)
            {
                throw new ArgumentNullException(nameof(propertyToCheck));
            }

            ITableCommands tableCommands = propertyToCheck(dbContext);

            if (tableCommands == null)
            {
                var paramName = nameof(dbContext);
                var message   =
                    String.Format(CultureInfo.InvariantCulture,
                                  "The table commands specified for the database context cannot be null.{0}Table Commands: {1}",
                                  Environment.NewLine,
                                  nameof(dbContext.RolesTableCommands));
                throw new ArgumentException(message, paramName);
            }
        }
コード例 #12
0
 public SqlServerUserStore(IIdentityDbContext identityDbContext)
 {
     _identityDbContext = identityDbContext;
 }
コード例 #13
0
 public PersistedGrantRepository(IIdentityDbContext loginDbContext)
 {
     _loginDbContext = loginDbContext;
 }
コード例 #14
0
 public UserStore(IIdentityDbContext <TUser, TRole> context, ILookupNormalizer normalizer)
 {
     _context    = context ?? throw new ArgumentNullException(nameof(context));
     _normalizer = normalizer;
 }
コード例 #15
0
 public DataSeeder(IIdentityDbContext identityDbContext)
 {
     _identityDbContext = identityDbContext;
 }
コード例 #16
0
 public UserRepository(IIdentityDbContext loginDbContext)
 {
     _loginDbContext = loginDbContext;
 }
コード例 #17
0
 public ApplicationUserStore(IIdentityDbContext context) : base((IdentityDbContext)context)
 {
 }
コード例 #18
0
 /// <summary>
 ///     Creates a new instance of the <see cref="RoleStore{TRole}"/>
 ///     class using the provided <see cref="IIdentityDbContext"/>.
 /// </summary>
 /// <param name="dbContext">
 ///     The instance of <see cref="IIdentityDbContext"/> to use when interacting with the database.
 /// </param>
 public RoleStore(IIdentityDbContext dbContext) : this(new RolesTable <TRole>(dbContext))
 {
 }
コード例 #19
0
ファイル: IdentityDatabase.cs プロジェクト: uxifiit/UXR
 public IdentityDatabase(IIdentityDbContext <ApplicationUser> context)
 {
     _context = context;
 }
コード例 #20
0
 public ResourceOwnerPasswordValidator(IIdentityDbContext dbContext, IPasswordValidator passwordValidator)
 {
     _passwordValidator = passwordValidator;
     _dbContext         = dbContext;
 }
コード例 #21
0
 public UserCreateRequestHandler(IIdentityDbContext context, IEmailService emailService)
 {
     _context      = context;
     _emailService = emailService;
 }
コード例 #22
0
 public UserPasswordResetRequestHandler(IIdentityDbContext context, IHashingService hashingService)
 {
     _context        = context;
     _hashingService = hashingService;
 }
コード例 #23
0
 public UserAuthenticateRequestHandler(IIdentityDbContext context, IPasswordValidator passwordValidator, IIdentityServerInteractionService interaction)
 {
     _context           = context;
     _passwordValidator = passwordValidator;
     _interaction       = interaction;
 }
コード例 #24
0
 /// <summary>
 ///     Creates a new instance of the <see cref="RolesTable"/>
 ///     class with the specified <see cref="IIdentityDbContext"/>.
 /// </summary>
 /// <param name="dbContext">
 ///     Instance of <see cref="IIdentityDbContext"/> to use when interacting with the database.
 /// </param>
 /// <exception cref="ArgumentException">
 ///     Thrown if the <see cref="IIdentityDbContext.RolesTableCommands"/>
 ///     property of the <paramref name="dbContext"/> parameter is <c>null</c>.
 /// </exception>
 internal RolesTable(IIdentityDbContext dbContext)
     : base(dbContext)
 {
     ThrowIfTableCommandsIsNull(dbContext, x => x.RolesTableCommands);
 }
コード例 #25
0
 public SqlServerIdentityResourceStore(IIdentityDbContext identityDbContext) :
     base(identityDbContext)
 {
 }
コード例 #26
0
 public SqlServerResourceStore(IIdentityDbContext identityDbContext)
 {
     IdentityDbContext = identityDbContext;
 }
コード例 #27
0
 public SqlServerBootstrapper(IIdentityDbContext identityDbContext, ILogger logger)
 {
     _identityDbContext = identityDbContext;
     _logger            = logger;
 }
コード例 #28
0
 public SqlServerClientStore(IIdentityDbContext identityDbContext)
 {
     _identityDbContext = identityDbContext;
 }
コード例 #29
0
 public SecurityRepository(ILog logger, IIdentityDbContext context)
 {
     _logger  = logger;
     _context = context;
 }
コード例 #30
0
 /// <summary>
 ///     Creates a new instance of the <see cref="UsersTable"/>
 ///     class with the specified <see cref="IIdentityDbContext"/>.
 /// </summary>
 /// <param name="dbContext">
 ///     Instance of <see cref="IIdentityDbContext"/> to use when interacting with the database.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 ///     Thrown if the <paramref name="dbContext"/> parameter is <c>null</c>.
 /// </exception>
 protected UsersTable(IIdentityDbContext dbContext) : base(dbContext)
 {
 }