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

Polling Push Factor Verification Using .NET SDK #507

Closed duser10 closed 5 months ago

duser10 commented 3 years ago

Current behavior

When calling the OktaApiClient.UserFactors.VerifyFactorAsync method in order to initiate a push factor verification for a user, it seems as though the transaction ID is only accessible by parsing the URLs found in the _links entry of the VerifyUserFactorResponse that is returned. Furthermore, it does not seem as though there is a direct way to issue a cancellation to the initiated push factor verification transaction through the SDK.

Expected behavior

It would be ideal to be able to access the transaction ID directly. Is there a way to do this currently? Also, is there a way to initiate a cancellation to the push factor verification transaction through the SDK?

Minimal reproduction of the problem with instructions

Sending the push factor verification, where "userId" is the Okta user ID, and "factorId" is the enrolled push factor ID for the user: var verifyResponseTask = _client.UserFactors.VerifyFactorAsync(userId, factorId); verifyResponseTask.Wait(); var verifyResponse = verifyResponseTask.Result;

Then to monitor the poll response, I believe that I would need to use the following code: var pollResponseTask = _client.UserFactors.GetFactorTransactionStatusAsync(userId, factorId, transactionId); pollResponseTask.Wait(); var pollResponse= pollResponseTask.Result;

However, obtaining transactionId takes a bit of work to parse from the resulting verifyResponse object in the first block of code above. Is there supposed to be a direct way of obtaining it or a different method of accomplishing this through the SDK that will provide the transactionId directly? What is the recommended method of allowing a cancellation of the push factor verification?

Environment

bryanapellanes-okta commented 3 years ago

@duser10, Thanks for reaching out! We will review your request more closely to determine the best solution. We'll comment here with more.

Thanks for using Okta!

bryanapellanes-okta commented 5 months ago

This issue should be resolved.