Skip to content

VCST-4576: Token validation setting, Mixed auth scheme instead of custom scheme provider#3006

Open
ksavosteev wants to merge 17 commits intodevfrom
feat/VCST-4576
Open

VCST-4576: Token validation setting, Mixed auth scheme instead of custom scheme provider#3006
ksavosteev wants to merge 17 commits intodevfrom
feat/VCST-4576

Conversation

@ksavosteev
Copy link
Copy Markdown
Contributor

@ksavosteev ksavosteev commented Apr 15, 2026

Description

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-4576

Artifact URL:


Note

High Risk
Changes core authentication/authorization defaults and token validation behavior, which can affect API access paths and session revocation semantics across all endpoints.

Overview
Authentication/authorization is refactored to use a new mixed default scheme (PlatformConstants.Security.AuthenticationSchemes.MixedScheme) implemented via an AddPolicyScheme selector that forwards to Bearer (OpenIddict validation), Basic, API key, or cookie auth, replacing the old CustomAuthenticationSchemeProvider approach and updating permission policies to target the mixed scheme.

Token/session handling is tightened and made configurable. A new AuthorizationOptions.EnablePersistentStorageTokenValidation toggle enables OpenIddict authorization/token entry validation (immediate revocation via DB), and session revocation is expanded: IUserSessionsService gains TerminateUserSessions(TerminateUserSessionsRequest) (supports excluding current session group), SecurityController now terminates sessions after successful password change/reset, and the user lockout/token revocation event handler switches to using IUserSessionsService instead of directly revoking via IOpenIddictTokenManager.

UI updates broadcast a password-changed event after reset so the sessions widget refreshes its session count.

Reviewed by Cursor Bugbot for commit 88e00c2. Bugbot is set up for automated code reviews on this repo. Configure here.

Image tag:
ghcr.io/VirtoCommerce/platform:3.1023.0-pr-3006-88e0-vcst-4576-88e00c20

Comment thread src/VirtoCommerce.Platform.Web/Startup.cs Outdated
Comment thread src/VirtoCommerce.Platform.Web/Startup.cs Outdated
Comment thread src/VirtoCommerce.Platform.Web/Startup.cs Outdated
@ksavosteev ksavosteev changed the title VCST-4576: Token validation setting, Mixed auth scheme instead of custom scheme provider VCST-4576, VCST-4531: Token validation setting, Mixed auth scheme instead of custom scheme provider Apr 16, 2026
@ksavosteev ksavosteev changed the title VCST-4576, VCST-4531: Token validation setting, Mixed auth scheme instead of custom scheme provider VCST-4576: Token validation setting, Mixed auth scheme instead of custom scheme provider Apr 16, 2026
@vc-ci
Copy link
Copy Markdown
Contributor

vc-ci commented Apr 16, 2026

🧪 Katalon Test Report — ✅ PASSED

🔢 Total ✅ Passed ❌ Failed
13 13 0
📋 Suite details
Suite Test Suites/Modules/module_Assets
Failures 0
Errors 0
Timestamp 22-04-2026T09:41:43

🔗 View run · Commit: f6171ca

Comment thread src/VirtoCommerce.Platform.Security/Services/UserSessionsService.cs
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4562323. Configure here.

Comment thread src/VirtoCommerce.Platform.Web/Controllers/Api/SecurityController.cs Outdated
@sonarqubecloud
Copy link
Copy Markdown

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.

3 participants