Auth0 的通用身份验证不允许注销

Universal Authentication for Auth0 doesn't allow logout

我正在编写一个使用 Auth0 身份验证的 Android 应用程序。我使用通用登录来允许用户登录。但是,问题是一旦用户登录,我似乎找不到注销的方法。如果我使用 CredentialsManager.clearCredentials() 选项,那么通用登录仍然会自动登录。有没有办法告诉通用登录到 "force" 登录?

WebAuthProvider.init(account)
            .withScope("openid profile email")
            .withScheme("android")
            .start(this, new AuthCallback() {

您可以通过将 login 作为 prompt 的值传递给 /authorize 来强制用户再次登录。您可以使用 withParameters() 执行此操作。 Source code.

身份验证 API 符合 OIDC,因此您可以查看 prompt here.

的文档

编辑:

要通过删除 Auth0 上的会话来真正注销用户,是将用户重定向到注销端点 https://YOUR_DOMAIN/v2/logout. In browsers and Javascript, this would be the equivalent of window.location.url = https://YOUR_DOMAIN/v2/logout