ya cleanup

This commit is contained in:
Paul Schneider
2025-02-16 17:28:38 +00:00
parent 5cc72cd846
commit 088634129e
17 changed files with 106 additions and 300 deletions

View File

@ -1,3 +1,4 @@
using System.Diagnostics;
using System.Globalization;
using System.Security.Cryptography.X509Certificates;
using Google.Apis.Util.Store;
@ -144,11 +145,9 @@ public static class HostingExtensions
o.EnableDetailedErrors = true;
});
AddIdentityDBAndStores(builder).AddDefaultTokenProviders();;
AddIdentityServer(builder).AddProfileService<ProfileService>();
//services.AddScoped<IProfileService, ProfileService>();
AddIdentityDBAndStores(builder).AddDefaultTokenProviders();
AddIdentityServer(builder);
services.AddSession();
// TODO .AddServerSideSessionStore<YavscServerSideSessionStore>()
@ -329,14 +328,17 @@ public static class HostingExtensions
.AddInMemoryClients(Config.Clients)
.AddInMemoryApiScopes(Config.ApiScopes)
.AddAspNetIdentity<ApplicationUser>()
.AddJwtBearerClientAuthentication();
// .AddProfileService<ProfileService>()
.AddJwtBearerClientAuthentication()
;
if (builder.Environment.IsDevelopment())
{
identityServerBuilder.AddDeveloperSigningCredential();
}
else
{
var key = builder.Configuration["YOUR-KEY-NAME"];
var key = builder.Configuration["YavscSigningCert"];
Debug.Assert(key != null);
var pfxBytes = Convert.FromBase64String(key);
var cert = new X509Certificate2(pfxBytes, (string)null, X509KeyStorageFlags.MachineKeySet);
identityServerBuilder.AddSigningCredential(cert);