我解决了这个问题如下:
- 按下注销按钮后立即调用 webAuthClient.signOutOfOkta(Activity)。
- ResultCallback中会返回结果,看是否登录。
- 调用 webAuthClient.sessionClient.clear()
像这样 :
webAuthClient.registerCallback(object : ResultCallback<AuthorizationStatus, AuthorizationException> {
override fun onCancel() {
network_progress.hide()
showMessage(getString(R.string.operation_cancelled))
}
override fun onError(msg: String?, exception: AuthorizationException?) {
signInError(msg, exception)
}
override fun onSuccess(result: AuthorizationStatus) {
network_progress.hide()
when (result) {
AUTHORIZED -> signInSuccess()
SIGNED_OUT -> webAuthClient.sessionClient.clear()
}
}
}, this)