namespace Identity.Host
{
    public static class StartupExtensions
    {
        public static IServiceCollection RegisterIds4(this IServiceCollection services)
        {
            services.AddIdentityServer(options =>
                {
                    options.Events.RaiseErrorEvents = true;
                    options.Events.RaiseInformationEvents = true;
                    options.Events.RaiseFailureEvents = true;
                    options.Events.RaiseSuccessEvents = true;
                })
                // in-memory, code config
                .AddTestUsers(InMemoryConfig.Users().ToList())
                .AddInMemoryApiResources(InMemoryConfig.GetApiResources())
                .AddInMemoryClients(InMemoryConfig.GetClients())
                .AddInMemoryApiScopes(InMemoryConfig.ApiScopes)
                .AddDeveloperSigningCredential();


            return services;
        }
    }
}
