- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
嘿,我正在使用 Firebase 身份验证并启用了 Google 登录 功能。Google 登录运行良好,我获得了所有信息。但是当我想将用户保存在 Firebase 用户列表中时,getIdToken()
为空:
private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
//here the acct.getIdToken() is null
AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
firebaseAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()) {
Toast.makeText(SignIn.this, "Authentication failed.", Toast.LENGTH_SHORT).show();
}
// [START_EXCLUDE]
progressDialog.hide();
// [END_EXCLUDE]
}
});
}
最佳答案
也许您忘记了在您的 GoogleSignInOptions 对象上使用 requestIdToken()
尝试一下:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
关于android - GoogleSignInAccount getIdToken() 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43179362/
我正在使用来自 javascript 客户端的 Firebase 身份验证进行测试,我正在尝试使用 retrieve id tokens on clients documentation 检索 idT
我正在使用 redux-saga和 redux-saga-firebase图书馆整合firebase使用 redux-sagas。问题是当我登录用户时,例如使用 signInWithEmailAndP
嘿,我正在使用 Firebase 身份验证并启用了 Google 登录 功能。Google 登录运行良好,我获得了所有信息。但是当我想将用户保存在 Firebase 用户列表中时,getIdToken
我正在开发一个 React Native 项目并使用 Firebase。 我试图让用户在验证其电子邮件地址后登录。我向用户发送一封注册电子邮件,用户单击验证链接来验证自己,然后应该能够登录。我当前的代
所以情况如下: 1) 用户已登录。最后生成的 token 是不久前生成的,并且已过期。即使没有,问题也不会出现。 2) 安装了应用程序更新。 (不是 android studio 即时运行的东西,实际
我不明白: FirebaseAuth.getInstance().currentUser.getIdToken(true).addOnSuccessListener { Log.d("tag"
因此,我在学习 Firebase/React 教程 (https://www.youtube.com/watch?v=m_u6P5k0vP0&t=2656s) 时遇到了问题。我在 auth 部分尝试设
我有一个 angularfire 身份验证服务,它工作得非常好——除了它不会刷新 token 。 我的刷新代码: firebase.auth().currentUser.getIdToken(true
我正在尝试使用 获取用户 token import { auth, database } from "firebase"; await token = await auth().currentUser
我正在使用 Firebase Auth 进行登录的 Next.js WEB/Node 应用上调试 session 超时问题。我正在利用自定义 token 来实现精细的 Firestore 安全规则。在
这是总是出错的行 String sess = "workid_token=" + AppHelper.getCurrSession().getIdToken().getJWTToken
我现在正在处理 firebase 身份验证,我正在关注这个 Firebase 文档。 访问https://firebase.google.com/docs/auth/admin/manage-cook
关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。 这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topi
我目前正在开发一个 Next.js (React) 项目,我使用 Firebase Auth 进行身份验证。我使用它连接到 REST API 后端,该后端接收 Firebase 提供的用户 token
我使用 this 在我的 firebase 项目上实现了 cookie session 关联。 我正在尝试获取 idToken在客户端将其发送到服务器端。 这是我在客户端使用的代码: $(functi
我在 Swift 中完成了以下操作: let currentUser = Auth.auth().currentUser currentUser?.getTokenForcingRefresh(tru
我一直在使用 FirebaseAuth 登录用户,并注意到 FirebaseUser 的 getToken 方法返回的 ID token 与 FCM FirebaseInstanceIdService
通过将 false 传递给 Auth.auth().currentUser?.getIDTokenForcingRefresh,该函数执行与 getIDToken 相同的操作,除了如果当前 token
如何在 firebase 版本 9 中使用 getIdToken() 身份验证方法? 在版本 8 中它是这样工作的 import firebase from "firebase"; const tok
我在 Angular 8 中使用 firebase 来验证前端和后端的用户。要在后端验证用户身份,我需要发送用户 ID token 。 我正在使用 firebase getIdToken 来获取 to
我是一名优秀的程序员,十分优秀!