-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
The following code:
static void Main(string[] args)
{
var client = new OrderCloudClient();
Task.WaitAll(client.PasswordResets.SendVerificationCodeAsync(new PasswordResetRequest
{
ClientID = "client-app-id",
Email = "my-email",
URL = "http://reset-password-url.com"
}));
}
throws an exception:
Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: clientID is required.
at OrderCloud.SDK.OrderCloudClient.Require(String value, String name)
at OrderCloud.SDK.OrderCloudClient.AuthenticateAsync(String clientID, String username, String password, ApiRole[] roles)
at OrderCloud.SDK.OrderCloudClient.<AuthenticateAsync>d__150.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OrderCloud.SDK.OrderCloudClient.<EnsureTokenAsync>d__160.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Flurl.Http.FlurlRequest.<SendAsync>d__19.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
at TestOrderCloud.Program.Main(String[] args) in c:\projects\TestOrderCloud\TestOrderCloud\Program.cs:line 16
This happens because reset password requests go through standard OC request infrastructure so it tries to authenticate before sending the request.
The expected behavior is that authentication is not required to reset password.
crhistianramirez
Metadata
Metadata
Assignees
Labels
No labels