okta-auth-swift icon indicating copy to clipboard operation
okta-auth-swift copied to clipboard

Resend new One Time Passcode after 5 minutes.

Open mdeveracoding opened this issue 2 years ago • 3 comments

Describe the bug?

We are implementing a custom MFA UI and are using resend code or one time passcode. We are successful in using resend code. However we are running into issues when invoking resend code/OTP....especially when the code has expired after 5 minutes.

What is expected to happen?

Receive a new one time passcode even if the original has expired after 5 minutes.

What is the actual behavior?

Using the snippet of code below, we get an exception message of "errorCode":"E0000011","errorSummary":"Invalid token provided","errorLink":"E0000011","errorId":"oae1Gut7BKiRr-6rb5kOhN1Kw","errorCauses":[]. Especially when trying to get a new one time passcode after the original has expired over 5 minutes. Please keep in mind ....using the same code below we can get a new one time passcode if we request a new OTP code within 5 minutes.

let mfaRecovery = currentStatus as! OktaAuthStatusFactorChallenge

mfaRecovery.resendFactor(onStatusChange: { status in
    self.handleStatus(status: status, result: result)}, onError: { error in
        Error(ErrorCodes.e805, result, error)
    })

Reproduction Steps?

Login with an account that has MFA policies. Request a new OTP after 5 minutes. Especially after the first OTP has been received via email or sms.

If the current behavior is a bug, please provide the steps to reproduce and a minimal demo if possible.

Additional Information?

No response

SDK Version(s)

'OktaAuthSdk', '2.4.3' 'OktaOidc', '3.5.2'

Build Information

No response

mdeveracoding avatar Apr 18 '22 20:04 mdeveracoding

@mdeveracoding Thanks for posting!

This seems similar to https://github.com/okta/okta-auth-java/issues/175.

cc: @mikenachbaur-okta

arvindkrishnakumar-okta avatar Apr 19 '22 18:04 arvindkrishnakumar-okta

Thanks for mentioning me @arvindkrishnakumar-okta. I'll keep an eye on the other issue to see what the response is, to help narrow then problem down.

mikenachbaur-okta avatar Apr 19 '22 18:04 mikenachbaur-okta

@arvindkrishnakumar-okta @mikenachbaur-okta , hi all, I have responded in https://github.com/okta/okta-auth-java/issues/175

mdeveracoding avatar May 02 '22 12:05 mdeveracoding