Ejemplo n.º 1
0
                public void WhenCalled_SetsSingleUseTokenWithConnectionString()
                {
                    var options = new TableIdentityOptions("ConnectionString");

                    Assert.NotNull(options.SingleUseToken);
                    Assert.Equal("ConnectionString",
                                 options.SingleUseToken.StorageAccountConnectionString);
                }
Ejemplo n.º 2
0
                public void WhenCalled_SetsTableStoreWithConnectionString()
                {
                    var options = new TableIdentityOptions("ConnectionString");

                    Assert.NotNull(options.TableStore);
                    Assert.Equal("ConnectionString",
                                 options.TableStore.StorageAccountConnectionString);
                }
Ejemplo n.º 3
0
        public static IServiceCollection AddThoughtHavenIdentity <TUser>(
            this IServiceCollection services, TableIdentityOptions options)
            where TUser : class, IUserKey, IUserId, IUserEmail, IUserCreated,
        IUserSecurityStamp, IUserLastLogin, new()
        {
            Guard.Null(nameof(services), services);
            Guard.Null(nameof(options), options);

            services.TryAddSingleton(options);
            services.TryAddSingleton(options.TableStore);

            services.AddSingleUseTokens(options.SingleUseToken);

            return(services.AddThoughtHavenIdentity <TUser, TableUserEmailStore <TUser>,
                                                     TableSingleUseTokenService, TableTimedLockoutStore>(options));
        }