Step Up Redirect in Okta Kotlin SDK - Flow is cancelled

I’m using the Okta Kotlin Mobile SDK using this flow:

I am running into an issue and don’t know how to resolve it.

  1. Login using this method (ie the mobile sdk launches a Chrome Custom tab to auth)
  2. Revoke the user’s sessions (ie “Clear Sessions & Revoke Tokens” using the Okta admin portal)
  3. Keep using the until the access token expires. When a new access token is requested using the (now revoked) refresh token, the user will be required to log in.
    4.) The enters valid credentials, but the login flow will now make a call to login/step-up/redirect?stateToken=thetokenhere, which returns a 302. This results in the Chrome Custom tab closing with an error result (specifically a FlowCancellationException).
    5.) The user must then relaunch the login to successfully get a token. This time it will be successful and the step up redirection does not happen.

Is this a bug in the Okta Kotlin Mobile SDK? If not, what is the correct way to handle this? How can I differentiate this issue from the user simply dismissing the Chrome Custom (which also results in a FlowCancellationException?

Stack trace:

com.okta.webauthenticationui.WebAuthenticationClient$FlowCancelledException: Flow cancelled.
                                                                                                    	at com.okta.webauthenticationui.DefaultRedirectCoordinator.emit(RedirectCoordinator.kt:123)
                                                                                                    	at com.okta.webauthenticationui.SingletonRedirectCoordinator.emit(Unknown Source:2)
                                                                                                    	at com.okta.webauthenticationui.ForegroundViewModel.flowCancelled(ForegroundViewModel.kt:78)
                                                                                                    	at com.okta.webauthenticationui.ForegroundActivity.onDestroy(ForegroundActivity.kt:88)
                                                                                                    	at android.app.Activity.performDestroy(Activity.java:8562)
                                                                                                    	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1452)
                                                                                                    	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5396)
                                                                                                    	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5442)
                                                                                                    	at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:47)
                                                                                                    	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                    	at android.os.Looper.loop(Looper.java:288)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7872)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)