Exemple #1
0
        private static async Task Initialize(IServiceProvider services)
        {
            var client = services.GetRequiredService <IBlobClient>();
            await ResourceStore.InitializeAsync(client);

            await ClientStore.InitializeAsync(client);
        }
Exemple #2
0
 // 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
 }
Exemple #3
0
        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();
            }
        }