Beispiel #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            // Includes Authentication/Authorization
            services
            .AddIdentityServer()
            .AddInMemoryApiResources(InMemoryConfig.GetApis()) // For basic demonstration, we are going to persist APIs in memory.
            .AddInMemoryClients(InMemoryConfig.GetClients())   // Same here we but for Clients in memory. Ideally these are really persisted / comes from a database/store.
            .AddDeveloperSigningCredential();                  // will add a local key to sign tokens - ONLY DEV

            // Without anything else
            // This url will currently be working.
            //https://localhost:5001/.well-known/openid-configuration

#if DEBUG
            services
            .AddControllersWithViews(
                options =>
            {
                options.SuppressAsyncSuffixInActionNames = true;
            })
            .AddRazorRuntimeCompilation();
#else
            services
            .AddControllersWithViews();
#endif
        }
Beispiel #2
0
        public void ConfigureServices(IServiceCollection services)
        {
            services
            .AddIdentityServer()
            .AddInMemoryIdentityResources(InMemoryConfig.GetIdentityResources())
            .AddInMemoryApiResources(InMemoryConfig.GetApis())
            .AddInMemoryClients(InMemoryConfig.GetClients())
            .AddDeveloperSigningCredential();

#if DEBUG
            services
            .AddControllersWithViews(
                options =>
            {
                options.SuppressAsyncSuffixInActionNames = true;
            })
            .AddRazorRuntimeCompilation();
#else
            services
            .AddControllersWithViews();
#endif
        }