Пример #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();

            string           certPath = Path.Combine(_env.ContentRootPath, "identity_token_server.pfx");
            X509Certificate2 cert     = new X509Certificate2(certPath, "w@s@m@ndr@kk@");

            services.AddIdentityServer()
            .AddInMemoryApiResources(ConfigServer.GetApiResources())
            .AddTestUsers(ConfigServer.GetUSers())
            .AddInMemoryClients(ConfigServer.GetClients())
            .AddSigningCredential(cert);
        }