Example #1
0
        /// <summary>
        /// Configures services
        /// </summary>
        /// <param name="services">services</param>
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            services.AddScoped <IUserRepository, UserRepository>();

            services.AddIdentityServer()
            .AddSigningCredential(RsaProvider.GenerateSigningCredential())
            .AddInMemoryIdentityResources(Config.GetIdentityResources())
            .AddInMemoryApiResources(Config.GetApiResources())
            .AddInMemoryClients(Config.GetClients())
            .AddProfileService <ProfileService>();

            services.AddTransient <IResourceOwnerPasswordValidator, ResourceOwnerPasswordValidator>();
            services.AddTransient <IProfileService, ProfileService>();
            services.AddTransient <IPersistedGrantStore, PersistedGrantStore>();
        }