okta / okta-sdk-dotnet

A .NET SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
Other
160 stars 100 forks source link

Using the UserFactors.EnrollFactorAsync result with "The request body was not well-formed" #466

Closed pilouk closed 3 years ago

pilouk commented 3 years ago

I'm trying to Enroll a user using the UserFactors.EnrollFactorAsync() with UserFactors.ListSupportedFactors() methods.

Current behavior

Using this code below result with "The request body was not well-formed"

            var lstFactors = await _oktaClient.UserFactors.ListSupportedFactors(HttpContext.User.FindFirstValue("uid")).ToListAsync();
            var factor = lstFactors.First();
            var rs = await _oktaClient.UserFactors.EnrollFactorAsync(factor, HttpContext.User.FindFirstValue("uid"));

Expected behavior

Should return a IUserFactor

Minimal reproduction of the problem with instructions

Use one item from the collection of ListSupportedFactors in the EnrollFactorAsync function.

Environment

bryanapellanes-okta commented 3 years ago

@pilouk , Thanks for reaching out, and sorry for the inconvenience. I'll review the code you've shared and attempt to determine what the issue is. I'll comment here when I have more to share.

bryanapellanes-okta commented 3 years ago

@pilouk , After repeated attempts I am unable to reproduce the behavior you describe. Are you able to provide a full project, preferably in a git repository, that reproduces the issue?

pilouk commented 3 years ago

@pilouk , After repeated attempts I am unable to reproduce the behavior you describe. Are you able to provide a full project, preferably in a git repository, that reproduces the issue?

The only factor that I support for now is SMS but for some reason the Factor.id is null, can this pose a problem ?

bryanapellanes-okta commented 3 years ago

The only factor that I support for now is SMS but for some reason the Factor.id is null, can this pose a problem ?

@pilouk There is no reason I'm aware of that Factor.Id would be null in a response from the server. Do you have a complete project sample reproducing the issue that you can share?

bryanapellanes-okta commented 3 years ago

Closing due to inactivity, feel free to reopen if you need additional assistance.