Externl Login
Some checks failed
Dotnet build and test / log-the-inputs (push) Successful in 6s
Dotnet build and test / build (push) Failing after 1m26s

This commit is contained in:
Paul Schneider
2025-07-10 15:19:28 +01:00
parent 19a3ba6f87
commit 984b76b170
12 changed files with 346 additions and 35 deletions

View File

@ -36,6 +36,7 @@ using Microsoft.IdentityModel.Protocols.Configuration;
using IdentityModel;
using System.Security.Claims;
using IdentityServer8.Security;
using Yavsc.Interfaces;
namespace Yavsc.Extensions;
@ -112,6 +113,7 @@ public static class HostingExtensions
AddYavscPolicies(services);
services.AddScoped<IAuthorizationHandler, PermissionHandler>();
services.AddTransient<IExternalIdentityManager, ExternalIdentityManager>();
AddAuthentication(builder);
@ -215,11 +217,12 @@ public static class HostingExtensions
// set the redirect URI to https://localhost:5001/signin-google
options.ClientId = googleClientId;
options.ClientSecret = googleClientSecret;
});
}
private static IIdentityServerBuilder AddIdentityServer(WebApplicationBuilder builder)
{
builder.Services.AddTransient<IProfileService,ProfileService>();
//builder.Services.AddTransient<IProfileService,ProfileService>();
var identityServerBuilder = builder.Services.AddIdentityServer(options =>
{
options.Events.RaiseErrorEvents = true;
@ -234,7 +237,7 @@ public static class HostingExtensions
.AddInMemoryIdentityResources(Config.IdentityResources)
.AddInMemoryClients(Config.Clients)
.AddInMemoryApiScopes(Config.ApiScopes)
.AddProfileService<ProfileService>()
// .AddProfileService<ProfileService>()
.AddAspNetIdentity<ApplicationUser>()
;
if (builder.Environment.IsDevelopment())