private static async Task Initialize(IServiceProvider services) { var client = services.GetRequiredService <IBlobClient>(); await ResourceStore.InitializeAsync(client); await ClientStore.InitializeAsync(client); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddIdentityServer() .AddInMemoryClients(ClientStore.GetClients()) .AddInMemoryIdentityResources(Resources.GetIdentityResources()) .AddInMemoryApiResources(Resources.GetApiResources()) .AddInMemoryApiScopes(Resources.GetApiScopes()) .AddTestUsers(TestUsers.GetTestUsers()) .AddDeveloperSigningCredential(); // TODO: IdentityServer uses an asymmetric key pair to sign and validate JWTs. Change this to a secure RSA key }
private static void InitializeClients(IServiceProvider services) { var options = services.GetRequiredService <IOptions <TableStorageConfigurationOptions> >(); // seed Clients var clientLogger = services.GetRequiredService <ILogger <ClientStore> >(); var clientStore = new ClientStore(options, clientLogger); foreach (var client in Config.GetClients()) { clientStore.StoreAsync(client).GetAwaiter().GetResult(); } }