HOME DOCUMENTATION DOWNLOADS

IdentityService - RessetPassword method not working

I have WF that resets user passwords using IdentityService service, ResetPassword method. But when I use it it throws an error

The thing is, that the @OrigamUser_parBusinessPartnerId parameter is only in step after ResetPassword and it is filled correctly with GUID from context by referencing /ROOT/BusinessPartner/Id. I can see the GUID in trace.

Any advice please?

I also checked server log, where I can see this:
2021-09-08 14:43:35,275 [22] ERROR Origam.ServerCore.Controller.AbstractController - One or more errors occurred. (Error occured when setting parameter: @OrigamUser_parBusinessPartnerId to value: 20406)
Origam.OrigamException: One or more errors occurred. (Error occured when setting parameter: @OrigamUser_parBusinessPartnerId to value: 20406)
—> System.AggregateException: One or more errors occurred. (Error occured when setting parameter: @OrigamUser_parBusinessPartnerId to value: 20406)
—> System.Exception: Error occured when setting parameter: @OrigamUser_parBusinessPartnerId to value: 20406
—> System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid.GuidResult.SetFailure(Boolean overflow, String failureMessageID)
at System.Guid.TryParseExactN(ReadOnlySpan1 guidString, GuidResult& result) at System.Guid.TryParseGuid(ReadOnlySpan1 guidString, GuidResult& result)
at System.Guid…ctor(String g)
at Origam.DA.Service.AbstractDataService.BuildParameters(QueryParameterCollection parameters, IDataParameterCollection dsParameters, UserProfile currentProfile)
— End of inner exception stack trace —
at Origam.DA.Service.AbstractDataService.BuildParameters(QueryParameterCollection parameters, IDataParameterCollection dsParameters, UserProfile currentProfile)
at Origam.DA.Service.DataLoader.Fill()
at Origam.DA.Service.Profiler.ExecuteAndTakeLoggingAction(DataStructureEntity entity, Action2 loggingAction, Action actionToExecute) at Origam.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery query, IPrincipal principal, DataSet dataset, String transactionId) at Origam.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery dataStructureQuery, IPrincipal principal, String transactionId) at Origam.Workflow.DataServiceAgent.LoadData(DataStructureQuery query, DataSet data) at Origam.Workflow.DataServiceAgent.Run() 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) at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId, String transactionId, String paramName1, Object paramValue1) at Origam.ServerCore.UserStore.GetOrigamUserDataSet(Guid methodId, String paramName, Object paramValue, String transactionId) at Origam.ServerCore.UserStore.FindOrigamUserRowById(String userId) at Origam.ServerCore.UserStore.FindByIdAsync(String userId, CancellationToken cancellationToken) at Origam.ServerCore.Authorization.CoreManagerAdapter.FindByIdAsync(String userId) at Origam.ServerCore.Authorization.CoreManagerAdapter.ResetPasswordFromUsernameAsync(String userName, String token, String newPassword) --- End of inner exception stack trace --- at Origam.Security.Identity.IdentityServiceAgent.ResetPassword() at Origam.Security.Identity.IdentityServiceAgent.Run() at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() at Origam.Workflow.ProfilingTools.<>c__DisplayClass4_0.<ExecuteAndLogDuration>g__FuncToExecute|0() at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Func1 funcToExecute, String logEntryType, String path, String id, Func1 logOnlyIf) at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Action action, String logEntryType, String path, String id, Func1 logOnlyIf)
at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.MeasuredExecution()
at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute()
— End of inner exception stack trace —

Looks like you are sending something like a customer number (20406) instead of a guid.

I have already find this par out. Well the parametr name is really UserName (type of string) so who would expect it should be UserId (type of guid).

Never the less now it says token is not valid. So I am still trying to find out whats wrong. Token seems to be generated OK. But really IdentityService.ResetPassword is not happy at all :slight_smile:

In Architect Trace I get:
at Origam.Security.Identity.IdentityServiceAgent.ResetPassword()
at Origam.Security.Identity.IdentityServiceAgent.Run()
at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute()
at Origam.Workflow.ProfilingTools.<>c__DisplayClass4_0.g__FuncToExecute|0()
at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Func1 funcToExecute, String logEntryType, String path, String id, Func1 logOnlyIf)
at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Action action, String logEntryType, String path, String id, Func`1 logOnlyIf)
at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.MeasuredExecution()
at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute()

In OrigamServer.log I get:
2021-09-08 19:03:14,748 [13] ERROR Origam.Workflow.WorkflowHost - Origam.Rule.RuleException: Neplatný token
at Origam.Security.Identity.IdentityServiceAgent.ResetPassword()
at Origam.Security.Identity.IdentityServiceAgent.Run()
at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute()
at Origam.Workflow.ProfilingTools.<>c__DisplayClass4_0.g__FuncToExecute|0()
at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Func1 funcToExecute, String logEntryType, String path, String id, Func1 logOnlyIf)
at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Action action, String logEntryType, String path, String id, Func`1 logOnlyIf)
at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.MeasuredExecution()
at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute()

Screenshots from HTML5 client.
Screenshot 2021-09-08 at 19.55.29

Just a short notice, I have checked also github source code (very briefly) and I dont see a reason why the function reports InvelidToken. All parameters are pass as strings and should be fine.

I would be happy for any advice.