omniauth for rails and ios authentication

前端 未结 2 1668
遇见更好的自我
遇见更好的自我 2021-01-12 05:06

I have a rails app that handles the api for an iOS client. I use devise, omniauth-facebook for rails. for the iOS client I\'m using Accounts and Social framework for the fac

相关标签:
2条回答
  • 2021-01-12 05:16

    I was able to achieve this using the omniauth-facebook-access-token Gem. https://github.com/SoapSeller/omniauth-facebook-access-token

    Create another oauth provider in your devise initializer called 'facebook_access_token', it can use the same credentials as the facebook provider.

    Post the token as the param 'access_token'. Use the query string ?format=json on the callback url if you want the final response from your app returned as JSON.

    0 讨论(0)
  • 2021-01-12 05:37

    When you creates a facebook(fb) app, you should indicate where is located the url callback, probably you set it in fb as: http://localhost:3000/bla/bla It works fine if you are testing in your own machine but to be able to test in your ios device then you should change localhost for something like your machine's ip (Ex. 192.168.1.1)

    0 讨论(0)
提交回复
热议问题