使用 Firebase OAuth 保护 RESTful API?

编程入门 行业动态 更新时间:2024-10-23 03:13:45
本文介绍了使用 Firebase OAuth 保护 RESTful API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-18 07:16:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/932760.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:OAuth   Firebase   API   RESTful

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!