Skip to content

Implement OIDC#50

Open
arktronic-sep wants to merge 14 commits intomainfrom
oidc
Open

Implement OIDC#50
arktronic-sep wants to merge 14 commits intomainfrom
oidc

Conversation

@arktronic-sep
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds OpenID Connect (OIDC) support to SAMA.Web, including admin-configurable settings, login UI, JIT provisioning, and shared group-to-role/workspace mapping logic (reused by LDAP). Also wires up local/CI support services and adds new unit/integration/system tests around the feature.

Changes:

  • Add OIDC authentication configuration, settings UI, login flow, and user provisioning.
  • Refactor group mapping sync into a shared service used by both LDAP and OIDC.
  • Add mock OIDC/LDAP containers for local dev + CI system tests; add/adjust related tests.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
SAMA.Web/docker-compose.yml Adds mock OIDC and LDAP services for local development.
SAMA.Web/Services/OidcPostConfigureOptions.cs Dynamically configures OpenIdConnectOptions from GlobalSettings at runtime.
SAMA.Web/Services/OidcAuthenticationService.cs JIT provisions/updates users from OIDC claims and applies group mappings.
SAMA.Web/Services/LdapAuthenticationService.cs Switches LDAP group mapping application to the new shared sync service.
SAMA.Web/Services/GroupMappingSyncService.cs New shared service for syncing admin role + workspace assignments from group mappings.
SAMA.Web/Services/GlobalSettingsService.cs Adds persisted global settings for OIDC configuration (enabled, authority, client, scopes, etc.).
SAMA.Web/SAMA.Web.csproj Adds OpenIdConnect authentication package reference.
SAMA.Web/Program.cs Registers OIDC auth scheme + post-configurer; registers new services in DI.
SAMA.Web/Pages/Admin/Settings/_SettingsLayout.cshtml Adds OIDC tab to admin settings navigation.
SAMA.Web/Pages/Admin/Settings/Oidc.cshtml.cs Adds admin page model for editing OIDC settings and clearing options cache.
SAMA.Web/Pages/Admin/Settings/Oidc.cshtml Adds admin UI for configuring OIDC settings.
SAMA.Web/Pages/Admin/Settings/GroupMappings.cshtml Updates UI text and adds “OIDC” as an identity provider option.
SAMA.Web/Pages/Account/Login.cshtml.cs Adds OIDC login initiation + callback handlers; blocks local login for external users.
SAMA.Web/Pages/Account/Login.cshtml Adds “Sign in with {Provider}” button when OIDC is enabled.
SAMA.Tests.Unit/Web/Services/OidcPostConfigureOptionsTests.cs Unit tests for OIDC post-configure behavior.
SAMA.Tests.Unit/Web/Services/OidcAuthenticationServiceTests.cs Unit tests for basic OIDC enabled/disabled conditions.
SAMA.Tests.Unit/Web/Services/NotificationChannels/EmailChannelHandlerTests.cs Minor null-forgiving adjustment in test capture.
SAMA.Tests.Unit/Web/Services/GroupMappingSyncServiceTests.cs Unit tests for ExtractCnFromDn moved to the new shared service.
SAMA.Tests.Unit/Web/Pages/Admin/Settings/LdapModelTests.cs Updates constructor substitute args after LDAP service DI change.
SAMA.Tests.Unit/Web/Pages/Account/LoginModelTests.cs Updates constructor substitute args after LoginModel DI change.
SAMA.Tests.System/SystemTestBase.cs Adds additional Playwright wait-for-network-idle after key actions.
SAMA.Tests.System/OidcTests.cs New system test covering OIDC login using the mock provider.
SAMA.Tests.Integration/Web/Services/OidcAuthenticationServiceTests.cs New integration tests for OIDC provisioning and group mapping behavior.
SAMA.Tests.Integration/Web/Services/LdapAuthenticationServiceTests.cs Updates LDAP integration test setup for new shared group mapping service.
.github/workflows/ci.yml Adds OIDC and LDAP mock service containers for system tests in CI.

@arktronic-sep arktronic-sep force-pushed the oidc branch 2 times, most recently from af8de27 to f40351b Compare March 11, 2026 20:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.

Comment on lines +120 to +124
public IActionResult OnGetOidcLogin(string? returnUrl = null)
{
returnUrl ??= Url.Content("~/");

var properties = new AuthenticationProperties
Comment on lines +57 to +61
options.Scope.Clear();
foreach (var scope in _globalSettings.OidcScopes.Split(' ', StringSplitOptions.RemoveEmptyEntries))
{
options.Scope.Add(scope);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants