如何使用JWT实现Facebook登录?

How should I setup Facebook authentication with JWT authorization? I have a separate frontend and backend. When specifing redirect address, I set FE as target, then FE send to BE the Facebook user access token. BE calls https://graph.facebook.com/v6.0/debug_token to validate it, then BE send back JWT to FE.

My problem is, if user does it who is not admin or developer in my Facebook app, then debug_token will raise an error.

{\"error\":{\"message\":\"(#100) You must provide an app access token or a user access token that is an owner or developer of the app\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"Aiz2H5q-gqU2yNcMNyiO8Fl\"}}

我是否使用错误的消息序列进行身份验证,生成JWT?我敢肯定,当时我实现了它,我在一篇文章中读了这种方法。

我是否应该重定向到FE而不是BE?

评论