使用Firebase OAuth保护RESTful API? [英] Securing RESTful API with Firebase OAuth?

查看:220
本文介绍了使用Firebase OAuth保护RESTful API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iOS和Web应用程序中使用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.org - 作为我的API的中间人。香港有几个选项可用于验证传入的请求 - https://getkong.org/plugins 。什么使用Firebase?智威汤逊认证? OAuth认证?密钥认证?

I'm thinking about using Kong - https://getkong.org - as a middleman for my API. Kong has a few options in relation to authenticating incoming requests - https://getkong.org/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 .com / holgersindbaek / 2cc55efd89517e21fbb52b4e95125003

这篇关于使用Firebase OAuth保护RESTful API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆