问题标签 [firebase-authentication]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
330 浏览

firebase - Firebase 跨域 javascript 身份验证

我正在使用 Firebase 作为后端实现书签服务(想想 Instapaper)。大多数情况下它工作得很好,但是我遇到了一个主要问题。

该服务的核心部分将是一个书签,允许用户为他们当前在浏览器中查看的页面添加书签(再次,如 Instapaper 的:https ://www.instapaper.com/save )。

我在实现这一点时遇到的第一个问题是,即使用户登录到我的 firebaseapp.com 页面,当来自小书签的 javascript 被触发时,该用户也没有显示为经过身份验证。我发现这很可能是由于跨域问题,所以接下来我实现了一个基于 iframe 的解决方案。这个想法是 iframe 的 url 托管在我的 firebaseapp.com 网站上,允许当前登录的用户显示为经过身份验证。

这在 Chrome 和 Firefox 中效果很好,但在 Safari 中失败,当 cookie 和网站数据的安全设置设置为“允许我访问的网站”而不是“始终允许”时(要求用户将该设置切换为“始终允许”不是实际的)。

这个问题有什么解决办法吗?每次在新域上单击小书签时都强制用户登录将非常不方便。在这一点上,我基本上没有想法(并且开始在网络开发方面超出我的深度)。

非常感谢您的帮助!

0 投票
2 回答
1650 浏览

firebase - ref.$authWithPassword 不是 Firebase 中的函数

在这些天中,一个错误跟随另一个 jeezzz... 使用 firebase 作为我的应用程序的简单数据源非常重要。当它崩溃时,我正要开始实施$firebaseSimpleLogin,但我发现虽然 stackoverflow 它已被弃用,取而代之的是$firebaseAuth. 但是,现在我无法更新控制器中的函数,因为它一次又一次地抛出相同的错误:

TypeError: ref.$authWithPassword 不是函数

我已将所有依赖项添加到我的控制器,从我的 firebase 源创建了 ref 对象,但仍然不允许我的用户(已经创建)登录 i。这是代码:

//修正 - 仍然收到错误 auth.$login('password', { email: username, password: password }) .then(function(user) { //Success callback console.log('Authentication succeed'); } , function(error) { //失败回调 console.log('认证失败'); }); } }]);

它告诉我 at ref.$authWithPassword 不是函数?我错过了一个插件吗?

我有以下版本的 firebase 和 Angular fire:

我已经进入此页面https://www.firebase.com/docs/web/guide/login/password.html,但无法使用我的登录/密码版本重新创建他们的选项。

非常感谢任何帮助,尤其是今天。谢谢。

0 投票
4 回答
3445 浏览

android - 如何处理用户在上次运行时使用 Firebase 登录的应用程序的冷启动

感谢 Firebase,用户可以在 G+、Facebook 或 Twitter 的帮助下登录。当他们被记录时,一切都很好。

当 Android 应用关闭并重新打开时,如何使用 Firebase API 重新启用之前成功登录的用户。在应用程序演示或文档中都没有解释。

以 Facebook 为例,sdk 似乎保存了令牌,这就是按钮处于连接状态的原因(表明您可以断开连接)。但是 Firebase 和其他身份验证系统呢?

0 投票
0 回答
144 浏览

firebase - Firebase - 关闭应用程序时让用户保持登录状态

如果用户关闭手机上的应用程序,有没有办法让用户保持登录状态,这样他们就不必每次都输入登录详细信息?

0 投票
1 回答
1045 浏览

android - 'Unable to contact the firebase server'

I am working on ionic hybrid mobile app using angularFire. I am implementing email/password authentication using $firebaseAuth service. It is working properly on chrome browser but when installed on android device it is giving error 'Unable to contact the Firebase server.' My andorid application has full network access permission and permissions to use data and wify.

code and APK link https://github.com/ajayparsana/MyFirebaseApp

Please help.

0 投票
1 回答
27 浏览

firebase - 是否有用于删除已注册 Firebase 用户的 API 调用?

我知道如何通过网络界面手动删除注册用户(这个问题也回答了这个问题)。这可以在不提供用户密码的情况下完成。

有没有办法在没有密码的情况下自动删除用户?我只发现需要用户密码的removeUser API 调用。

这将有助于简化测试/阶段环境的部署。

0 投票
0 回答
2480 浏览

firebase - Firebase - 是否可以从私人服务器检查用户的连接状态?

大家好,

在移动应用程序上使用 Firebase,我要求我的服务器签署上传到第三方服务。在该脚本中,我将在授予用户所需的签名之前进行几项检查。我想做一个但不知道如何检查该用户当前是否连接到 Firebase。

可能吗 ?

提前谢谢!

0 投票
1 回答
1262 浏览

php - Firebase:如何使用 php 服务器端脚本检查客户端会话

我正在通过 Firebase SDK 对客户端进行身份验证,以便用户访问我的应用程序。然后启动客户端会话。我希望用户能够向 PHP 端点发布一些数据。我希望 PHP 脚本检查请求是否来自经过身份验证的用户,然后验证其余数据。如果一切正常,我们将完成操作。

我想这样做:

  • 用户是经过身份验证的客户端
  • 在 Auth 事件中,通过 ajax 向专用 PHP 脚本发出对带有用户 ID 的 JWT 令牌的请求。生成令牌后,它将存储在会话 cookie 中。
  • 表单提交将携带 JWT 令牌,端点将解码令牌并检查存储在其中的 uid 是否是在 Firebase DB 中注册的有效用户 ID。

从安全的角度来看是好主意还是坏主意?

0 投票
1 回答
1942 浏览

firebase - 有没有办法使用 Firebase 检查凭据?

我正在使用 Firebase Auth (web API) 并正在寻找一种方法来检查用户的电子邮件/密码组合的有效性以进行帐户删除。

理想情况下,像这样的电话Firebase.isValidCredentials(email, password)

问题上下文:在我的应用程序中,当用户请求删除他/她的帐户时,我想提示重新输入他们的密码作为确认。如果正确,则应删除该帐户以及所有其他关联数据(位于不同的 Firebase 节点下)。

虽然凭据检查是由 完成的Firebase.removeUser(),但它也会删除 auth:ed 帐户,这会破坏我删除用户数据的能力(因为我已将 Firebase 安全设置为需要主动身份验证来操作用户数据节点)。

感谢此处的指导,以及是否有用于删除用户帐户和用户数据的 Firebase 配方。

0 投票
1 回答
567 浏览

firebase - Firebase authWithOAuthToken not working

I am using Firebase in my Google Chrome App. Since Chrome Apps do not have a domain and a callback url, I need to authorize with the Token and not the popup.

I am having problems getting authWithOAuthToken to work, even in the browser.

In this code example the first call to authWithOAuthPopup works, I get the popupData which includes github account info and my token. The issue is that the second call to authWithOAuthToken is not working. I get an error

My console output shows the first call working, and the second call failing:

How can I get authWithOAuthToken to work?