Somehow OrigamUser is probably used during SSO, because when we updated the UserName in OrigamUser table, it started to work.
Here is the error from the log (domain name and username was changed):
2025-09-03 13:49:02,587 [66] ERROR Origam.Security.AbstractProfileProvider - Uživatel DOMAIN\USER nemá přístup do systému.
Origam.Security.ProfileNotFoundException: Uživatel DOMAIN\USER nemá přístup do systému.
at Origam.Security.OrigamProfileProvider.GetProfile(String userName) in D:\a\1\s\backend\Origam.Security\OrigamProfileProvider.cs:line 82
2025-09-03 13:49:02,911 [66] ERROR Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware - An unhandled exception has occurred while executing the request.
System.AggregateException: One or more errors occurred. (Uživatel DOMAIN\USER nemá přístup do systému.)
---> Origam.Security.ProfileNotFoundException: Uživatel DOMAIN\USER nemá přístup do systému.
at Origam.Security.OrigamProfileProvider.GetProfile(String userName) in D:\a\1\s\backend\Origam.Security\OrigamProfileProvider.cs:line 82
at Origam.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery query, IPrincipal principal, DataSet dataset, String transactionId)
at Origam.Workflow.DataServiceAgent.LoadData(DataStructureQuery query, DataSet data) in D:\a\1\s\backend\Origam.Workflow\Service Agents\DataServiceAgent.cs:line 85
at Origam.Workflow.DataServiceAgent.Run() in D:\a\1\s\backend\Origam.Workflow\Service Agents\DataServiceAgent.cs:line 421
at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId, String transactionId, QueryParameterCollection parameters, DataSet currentData, String entity, String columnName) in D:\a\1\s\backend\Origam.Workbench.Services\CoreServices\DataService.cs:line 92
at Origam.Server.UserStore.GetOrigamUserDataSet(Guid methodId, String paramName, Object paramValue, String transactionId) in D:\a\1\s\backend\Origam.Server\Authorization\UserStore.cs:line 316
at Origam.Server.UserStore.FindOrigamUserRowByUserName(String normalizedUserName, String transactionId) in D:\a\1\s\backend\Origam.Server\Authorization\UserStore.cs:line 273
at Origam.Server.UserStore.FindByNameAsync(String normalizedUserName, String transactionId, CancellationToken cancellationToken) in D:\a\1\s\backend\Origam.Server\Authorization\UserStore.cs:line 113
at Origam.Server.UserStore.FindByNameAsync(String normalizedUserName, CancellationToken cancellationToken) in D:\a\1\s\backend\Origam.Server\Authorization\UserStore.cs:line 109
at Microsoft.AspNetCore.Identity.UserManager`1.FindByNameAsync(String userName)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Origam.Server.IdentityServerGui.Account.ExternalController.FindUserFromExternalProvider(AuthenticateResult result) in D:\a\1\s\backend\Origam.Server\IdentityServerGui\Account\ExternalController.cs:line 221
at Origam.Server.IdentityServerGui.Account.ExternalController.Callback() in D:\a\1\s\backend\Origam.Server\IdentityServerGui\Account\ExternalController.cs:line 142
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Origam.Server.Middleware.FatalErrorMiddleware.Invoke(HttpContext context) in D:\a\1\s\backend\Origam.Server\Middleware\FatalErrorMiddleware.cs:line 43
at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService)
at IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)