Compare commits

..

4 Commits

Author SHA1 Message Date
khwezi 21788c66a3 Merge pull request 'Added data protection keys to web iodc middleware regirtration method' (#120) from dataprotection into master
Reviewed-on: #120
2026-06-13 23:34:35 +02:00
Khwezi Mngoma dfaa62ea75 Added data protection keys to web iodc middleware regirtration method
continuous-integration/drone/pr Build is passing
2026-06-13 23:34:07 +02:00
khwezi 54ef7a6e5f Merge pull request 'Fixed cookie and header collision issue on signout' (#119) from logout-fix into master
Reviewed-on: #119
2026-06-13 23:07:22 +02:00
Khwezi Mngoma 0ec7ef4861 Fixed cookie and header collision issue on signout
continuous-integration/drone/pr Build is passing
2026-06-13 23:06:53 +02:00
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -53,6 +53,12 @@ public static class Api
public static IServiceCollection AddLiteCharmsWebSecurity(this IServiceCollection services, IConfiguration configuration)
{
var keysFolder = Path.Combine("/app/shared-keys");
services.AddDataProtection()
.PersistKeysToFileSystem(new DirectoryInfo(keysFolder))
.SetApplicationName("MidrandBooks");
var configSection = configuration.GetSection(nameof(LiteCharmsSettings));
var authOptions = new LiteCharmsSettings();
@@ -77,6 +83,8 @@ public static class Api
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.ForwardSignOut = CookieAuthenticationDefaults.AuthenticationScheme;
options.Scope.Clear();
options.Scope.Add("openid");
options.Scope.Add("profile");
@@ -159,7 +167,6 @@ public static class Api
authProperties.Parameters.Add("id_token_hint", idToken);
await context.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme, authProperties);
await context.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
});
return app;
@@ -194,6 +194,7 @@
<!-- Shared Usings -->
<ItemGroup>
<Using Include="Microsoft.AspNetCore.DataProtection" />
<Using Include="Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage" />
<Using Include="System.Text.Json.Serialization" />
<Using Include="System.Reflection" />