【发布时间】:2022-12-11 05:32:47
【问题描述】:
我有一个使用 MSAL 库进行身份验证的 android 本机应用程序。登录后我们面临从应用程序注销的问题。注销时,它会显示一个屏幕,其中显示已登录的电子邮件,点击该屏幕可让用户无需密码即可登录应用程序。该应用程序配置为多帐户模式。下面是注销的代码。
removeAccountButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (mMultipleAccountApp == null) {
return;
}
/**
* Removes the selected account and cached tokens from this app (or device, if the device is in shared mode).
*/
mMultipleAccountApp.removeAccount(accountList.get(accountListSpinner.getSelectedItemPosition()),
new IMultipleAccountPublicClientApplication.RemoveAccountCallback() {
@Override
public void onRemoved() {
Toast.makeText(getContext(), "Account removed.", Toast.LENGTH_SHORT)
.show();
/* Reload account asynchronously to get the up-to-date list. */
loadAccounts();
}
@Override
public void onError(@NonNull MsalException exception) {
displayError(exception);
}
});
}
});
它总是显示吐司“帐户已删除”,但实际上不是。任何帮助表示赞赏!
【问题讨论】: