Which one HTTP gem should I use - ruby-on-rails

I want to create microservice (probably as a gem) and It will be REST client to call external API. I'm new at rails and I am investigating which gem I should use. I checked https://www.ruby-toolbox.com/categories/http_clients to verfify most popular gems and I'm reading about them on google. I thought to write a question and ask you about your favourite one. I will call JSON API using token auth. Which one I should use? Thanks for all answers.

The 'Devise' gem is the most popular gem for Rails with authentication.
These links here will provide you with more details on how to configure Devise to work with a JSON API using token auth:
http://abhionrails.com/ruby/rails/devise/token/based/authentication/api/json/2013/09/01/Devise-with-token-based-authentication-for-API/
Is this Rails JSON authentication API (using Devise) secure?

Related

How to create a user authentication using rails as backend and ember as frontend

I'm working on eCommerce for my internship project. But I don't know how to create the user authentication using rails and ember
First I assume the following things:
You are using ember to develop your frontend and will consume APIs from the backend.
You are using rails to create the necessary API.
If you want to authenticate users before using your API, check out the doorkeeper and devise gem. Devise takes care of things like storing your user details in the database, resetting the password, etc. The Doorkeeper gem is used to provide authentication and authorization to APIs.
Doorkeeper Link: https://github.com/doorkeeper-gem/doorkeeper
Devise Link: https://github.com/heartcombo/devise

How to access WP REST API via OAuth by using Rails

I can't figure out how to access Wordpress via REST API with OAuth.
My App is made by Ruby on Rails. So I'd like to use RoR 5.1.
My objective is to get all post from the api.
As far as I check, no appropriate gem is there.
Anyone help please.
In Rails the common gem to deal with OAuth is OmniAuth.
1) If you did your authentication system based on Devise then you have an easy way to add OAuth to your app.
Here a good example to connect to Facebook API with Devise:
https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
Here the gem to connect with WordPress:
https://github.com/jwickard/omniauth-wordpress-oauth2-plugin
2) If you didn't your authentication system with Devise then check the OmniAuth documentation to add it to your app:
https://github.com/omniauth/omniauth
And of course you will use the WordPress gem to add the strategy as well.

Official BigCommerce-api-ruby gem not using OAuth?

So I know that BigCommerce is transitioning completely over to OAuth soon, but their "official" ruby gem still uses the old API key authentication (from connection.rb):
"#{#configuration[:store_url]}/api/v2#{path}.json"
I'm considering transitioning over to the unofficial community-based bigcommerce_api gem instead, but then I'll have to change the api calls in most cases inside of my code.
Thoughts? Does anyone know if BigCommerce is going to update their gem before the transition is complete?
I don't think they've mentioned an exact time when they transition completely to OAuth yet.
However, I've made this gem which supports all the current BigCommerce APIs using OAuth.
One of the advantages of my gem is that it uses the same structure as the official gem which makes it easy to switch to using OAuth without having to rewrite your existing code.

how to read data from api without any gem rails 3

I want to read data from an API ean without using any gem. What I want is when the user searches for a particular hotel then my query should return me a data from ean.
How can I go about this thing? and how/where do I add the api key and secret ?
You can perform HTTP requests in Ruby using the Net::HTTP standard library.
Most people prefer to use third party Gems because they offer additional features or cleaner API, compared to Net::HTTP.
However, most of them is based on Net::HTTP itself.
Its a soap API you can use savon to build your own class to access that api. YOu will find a screencast for savon here: http://railscasts.com/episodes/290-soap-with-savon I had a look at the documentation its pretty well documented.

Need Recommendations for Twitter and Facebook Gems

I'm building an app in Rails 3. I currently have a user model which is authenticated via devise (email + password auth). I want to be able to show connect to facebook, connect to twitter buttons to the users once they are logged in.
After obtaining the keys from Facebook and Twitter, I'd want to store it in the database for future requests.
Which Ruby Gems should I be using for this use case?
Thanks!
Instead of Facebooker, we just implemented a facebook-connect style login and application using mini_fb
Mini_fb uses the new graph API, which is cool, and was easy to implement. We used Rails3 and authlogic, but difference to devise should be negligible.
For twitter, this twitter gem is nice, but this devise-twitter gem looks nice for login.
Okay, still no answers. Please check out the Ruby Toolbox, I'm sure the answer is there. It will tell you what the most common gems are for your problem if you can figure out the categorization system. Also, facebooker is a nice gem but it's a little old.
Facebooker is deprecated in favour of mogli, which uses the Graph API. And for Twitter, I'd recommend John Nunemaker's twitter. Since you are already using Devise, you can use the devise-twitter as mentioned by Jesse Wolgamott.

Resources