Firebase是否具有用于桌面应用的基于Web的身份验证的天然功能?
我有一个QT应用程序,我想通过网页进行身份验证。我所做的大概如下。
- 我在QT C ++应用程序上单击一个“登录”按钮,该应用(使用TLS)与身份验证服务器建立了连接(也许在我的firebase网站的端点上引起了邮政请求),该请求将发送回一次登录。令牌。
- 然后,QT应用程序打开Web浏览器,并将用户导航到身份验证URL,并将步骤1的登录令牌作为GET请求编码。
- 用户在此网页上执行登录。
- 一旦登录成功,Firebase Cloud功能将将用户ID令牌直接发送到我的QT桌面应用程序(基于步骤1中生成的登录令牌),然后我可以使用它来从我的QT应用程序访问Cloud Firestore。
这个想法是使用Firebase Cloud功能来完成此过程中涉及的所有后端内容。
我知道我可以直接使用Firebase Authentication SDK来完全剪切Web浏览器,并在我的QT应用程序内进行身份验证,但是出于可扩展的原因,我想使用网页(例如,如果我想添加其他符号, - 在将来的方法中,我只需要更新登录网站,而不是QT应用程序)。另外,如果用户已经在网站上登录,则无需再次登录该应用程序。
这可能吗? Firebase是否有任何本地功能可以使此类工作? Firebase Cloud功能是否适用于这种功能?
I have a Qt app that I would like to authenticate through a webpage. The rough idea I have goes as follows.
- I click a "Login" button on my Qt C++ app, which (using TLS) establishes a connection with the authentication server (perhaps with a POST request to an endpoint of my Firebase site), which sends back a one-time sign-in token.
- The Qt app then opens the web browser and navigates the user to an authentication URL, with the sign-in token from step 1 encoded in the URL as a GET request.
- User performs sign in on this webpage.
- Once sign in is successful, Firebase cloud functions sends back a user ID token directly to my Qt desktop app (based on the sign-in token generated in step 1), which I can then use to access Cloud Firestore from my Qt app.
The idea is to use Firebase Cloud Functions to do all the back end stuff involved in this process.
I know I can directly use the Firebase authentication SDK for this to cut out the web browser altogether and just do authentication from inside my Qt app, but I'd like to use a webpage for extensibility reasons (E.g. if I wanted to add other sign-in methods in the future, I'd only have to update the sign-in website, rather than the Qt app). Also if user is already signed in on the site, they wouldn't need to sign into the app again.
Is this possible? Does Firebase have any native functionality to make something like this work? Would Firebase Cloud Functions even work for this sort of functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论