[英]How to know if user is authenticated with Google auth using Firebase on Nodejs?
I've used Google auth using Firebase on Android app before.我之前在 Android 应用程序上使用 Firebase 使用 Google auth。 But this time I want my backend server to know if user is authenticated or not.
但是这次我希望我的后端服务器知道用户是否经过身份验证。 User will authenticate using Firebase auth from Flutter app.
用户将使用 Flutter 应用程序中的 Firebase auth 进行身份验证。 Right now I've done simple email and password auth.
现在我已经完成了简单的 email 和密码验证。 Flutter will send username and password to the server and server is authenticating using Firebase.
Flutter 将用户名和密码发送到服务器,服务器正在使用 Firebase 进行身份验证。 But I don't know how to do in case with Google or Facebook auth.
但我不知道如何使用 Google 或 Facebook 身份验证。
Using Google or Facebook login the first thing is to login via plugging that does the authentification for you and will give you back some information about the login.使用 Google 或 Facebook 登录,第一件事是通过插件登录,该插件会为您进行身份验证,并将返回一些有关登录的信息。 Next step is to send the token to your server and the server will need to check with Google or Facebook if it's valid (With these verification we can verify that the user has done the sign in with the third party correctly).
下一步是将令牌发送到您的服务器,服务器将需要与 Google 或 Facebook 核对是否有效(通过这些验证,我们可以验证用户是否已正确登录第三方)。
I have used for Flutter the next dependency:我已经为 Flutter 使用了下一个依赖项:
For NodeJs verification in the Back-end:对于后端的 NodeJs 验证:
You need to follow the steps in the documentation to install the dependencies and you will need firebase.您需要按照文档中的步骤安装依赖项,并且需要 firebase。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.