Philly
Philly

Reputation: 3

React-native FBSDK with rails omniauth-facebook 6 years later

I am implementing Facebook login in expo react native app using react-native-fbsdk-next library.

Through the react library I am able to obtain access token along with profile information such as name, email and profile picture. That however takes me one step further then required.

The rails backend with omniauth-facebook expects a lower level 'code/token' in order to get the the higher level access token and then the profile information. Without the lower level token I am unable to use the rails library. And with the fbsdk I am unable to obtain the lower level token.

I could potentially be sending the profile data directly from the mobile app to the backend to create/log in users, but that poses potential security risk.

The fbsdk documentation does not mention anything about obtaining the mentioned token, neither does the rails omniauth how to use the other token.

The 'code/token' is mentioned here

Any ideas?

Upvotes: 0

Views: 66

Answers (1)

Philly
Philly

Reputation: 3

Our backend team managed to make it work by adapting the previously forked version of omniauth to the newer gem version. Now it supports the 'higher level token' and returns the profile data.

https://github.com/ruby-logic/omniauth-facebook

Upvotes: 0

Related Questions