Firebase revokeRefreshTokens in backend server then firebase.auth().signOut() then try to login (google provider)

huangapple 未分类评论51阅读模式
英文:

Firebase revokeRefreshTokens in backend server then firebase.auth().signOut() then try to login (google provider)

问题

我正在使用Firebase进行身份验证,使用firebaseui-web。
以下是问题的使用情况:

  1. 用户通过firebaseui成功登录
  2. 在后端服务器上验证令牌:FirebaseAuth.getInstance().verifyIdToken(idToken)
  3. 用户按下注销按钮
  4. 后端吊销刷新令牌以使令牌无效(我错了吗?!):FirebaseAuth.getInstance().revokeRefreshTokens(decodedToken.getUid());
  5. 用户尝试重新验证身份,firebaseui显示,但当客户端立即按下“使用Google登录”按钮时,显示错误消息:“请再次登录以执行此操作 Dismiss”;显然,Google服务器表示令牌已过期(400)
  6. 几秒钟后,用户尝试重新验证身份,这次成功。

您能帮我解决这个问题吗?
非常感谢。

英文:

I'm using Firebase for authentication using firebaseui-web.
Following is the issue use case :

  1. The user login via firebaseui successfully
  2. The token is validated in backend server: FirebaseAuth.getInstance().verifyIdToken(idToken)
  3. The user press logout button
  4. The backend revokes the refresh token in order to invalidate the token (Im I wrong?!) : FirebaseAuth.getInstance().revokeRefreshTokens(decodedToken.getUid());
  5. The user tries to reauthenticate, the firebaseui is displayed but when the client press immediateley the "sign in with google" button an error message is shown: "Please login again to perform this operation Dismiss"; Apparently google server telss that the token is expired (400)
  6. After some seconds the user retries to authenticate and it works.

Can you help me please resolve this issue?
Thank you in advance.

huangapple
  • 本文由 发表于 2020年5月4日 03:23:45
  • 转载请务必保留本文链接:https://java.coder-hub.com/61580378.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定