rails-devise-cors-jwt-example
rails-devise-cors-jwt-example copied to clipboard
Auth API for facebook and vk.com
can i add this oauth2 of my social network login via my api i am going to use this for create ios app but i need facebook login vai my rails api can you advice me how i can do it i done login via social network in my rails app without api thats why i am asking you if the way is same i can create social login api i use oauth2 gem
Thanks for your example it work rails 5 good too
Hey @saroar I would advise using a tried and true solution like Doorkeeper or Omniauth. My example is much simpler and did not cover OAuth. I also have slides with more information on other ways to deal with authentication and mobile APIs here:
http://www.slideshare.net/jimjeffers/building-mobile-friendly-apis-in-rails
hi @jimjeffers thanks for you quict reply i remember i use Omniauth for my rails app without API but will be good with you this exm with Omniauth ? i see your slider but little bit confuse with will be best so hope you will advice me one which i can use for my iOS and andriod app thanks
also like to ask what you think if i will add this gem active_model_serializers into this example
I can't offer any personal advice to your specific application. I am using Grape, Doorkeeper, Devise, and Active Model Serializers on another project and have gotten great results. That being said, there is quite a bit of integration work that goes beyond the scope of the example here. The answer is yes - you can use those tools with this example, but bear in mind that you will no longer need devise for much aside from manual account creation. OmniAuth and Doorkeeper will handle the actual authentication from that point onward and you'd want to remove the login routes from devise if you plan on going that route.
is your another project is private if not can you share with me only auth part with me thanks
@saroar Sorry but it is for a client. Perhaps I can put together a more in-depth tutorial on how I did it at a later point in time but unfortunately I don't have any free time do so at the moment! I can say that you can use the technologies you are interested in. I would recommend attempting to build a project with Doorkeeper and Omniauth to see if you can get the desired outcome without worrying about devise as I showed in this example.