问题描述
限时送ChatGPT账号..我在 iOS 和网络应用中使用 Firebase 来处理用户身份验证.我需要确保用户已登录,然后才能向我的 API 发出任何请求.我将如何使用 Firebase 完成这样的事情?
I'm using Firebase in my iOS and web app to handle user authentication. I need to make sure a user is logged in before he can make any requests to my API. How would I accomplish such a thing with Firebase?
我正在考虑使用 Kong - https://getkong - 作为我的 API 的中间人.Kong 有几个与验证传入请求相关的选项 - https://getkong/plugins.Firebase 有什么用?JWT认证?OAuth 身份验证?密钥认证?
I'm thinking about using Kong - https://getkong - as a middleman for my API. Kong has a few options in relation to authenticating incoming requests - https://getkong/plugins. What would work with Firebase? JWT authentication? OAuth authentication? Key authentication?
您能指出一个基本示例的方向吗?或者给我一个关于我应该寻找什么的基本概述?
Can you point me in the direction of a basic example? Or give me a basic overview of what I should be looking for?
推荐答案
我最终验证了用户令牌服务器端,如下所示:
I ended up authentication the users token server-side, like this:
https://gist.github/holgersindbaek/2cc55efd89517e241fbb512a
https://gist.github/holgersindbaek/2cc55efd89517e21fbb52b4e95125003
这篇关于使用 Firebase OAuth 保护 RESTful API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论