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

DeleteFactorAsync not removing phone with removeEnrollmentRecovery #630

Closed MHFAtperrotti closed 1 year ago

MHFAtperrotti commented 1 year ago

Describe the bug?

Resetting an active Okta SMS factor using the UserFactorApi.DeleteFactorAsync with removeEnrollmentRecovery = true, the SMS factor status is set to "NOT_SETUP", but the registered phone number is not removed. As a result, when re-enrolling the SMS factor with the same phone number, the factor is set to "ACTIVE" with no passcode sent or verified. await _userFactorApi.DeleteFactorAsync(userId, factorId, removeEnrollmentRecovery: true);

Using the Reset Factor API directly with the "removeRecoveryEnrollment" query parameter successfully deletes the stored phone number.
{{url}}/api/v1/users/{{userId}}/factors/{{factorId}}?removeRecoveryEnrollment=true

What is expected to happen?

Using UserFactorApi.DeleteFactorAsync with removeEnrollmentRecovery = true should delete the registered phone number in addition to setting the SMS factor status to "NOT_SETUP".

What is the actual behavior?

The SMS factor status is set to "NOT_SETUP", but the registered phone number is not deleted.

Reproduction Steps?

Additional Information?

UserFactorApi.DeleteFactorWithHttpInfoAsync sets the query parameter "removeEnrollmentRecovery", but the Factor API docs list the parameter as "removeRecoveryEnrollment".

localVarRequestOptions.QueryParameters.Add(Okta.Sdk.Client.ClientUtils.ParameterToMultiMap("", "removeEnrollmentRecovery", removeEnrollmentRecovery));

Factors | Okta Developer https://developer.okta.com/docs/reference/api/factors/#reset-factor

.NET Version

.NET Framework 4.8.4614.0

SDK Version

6.0.6

OS version

BuildNumber Caption OSArchitecture Version 14393 Microsoft Windows Server 2016 Standard 64-bit 10.0.14393

laura-rodriguez commented 1 year ago

Hi @MHFAtperrotti,

Thanks for reporting this issue. I'll file an internal ticket to be reviewed and prioritized by the team.

Internal Ref: OKTA-592623