Official BigCommerce-api-ruby gem not using OAuth? - ruby-on-rails

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.

Related

Setting up Rails Api with Devise JWT for ReactJS Web App in 2019

I'm trying to create a new web app using RoR Api and Devise for User authentication and a ReactJS front-end. What I'm looking for are links to an up-to-date github app that uses these things with clean, up-to-date code as well as links to any tutorials that are also up-to-date (as of April 2019).
I'm in the process of using Devise in my app for the api and the issues I am having are essentially different tutorials doing it a bunch of different ways.
Always refer to the official docs on GitHub for every gem.
They are always up to date and fairly simple to use.
For Devise, refer to Devise Gem
For JWT, refer to JWT Gem
For ReactJS with Rails, refer to React-Rails Gem
I am using the same gems. Visit the links, read them thoroughly and follow the instructions diligently. Always works.
Hope it helps.

Rails authentication system for web and API

I am looking for an authentication system for Ruby on Rails. However there seems no gem that supports both direct web authentication (e.g. like devise does) and API authentication (like devise_token_auth). The both I mentioned seem incompatible to each other (at least I got some errors after adding the devise_token_auth to a project with devise already set up). Devise used to have an API authenticable but it was removed (there's probably a good reason for that, however I couldn't find one online).
Is there any gem that can do both of those methods (web and api), or do I need to build some JavaScript based solution, like in the ng-token-auth Live Demo?
I won't reject a JavaScript solution as long as it doesn't dramatically increase load times or is hard to understand/customize. I just can't believe there is no solution to such a common problem.
I took a closer look at devise_token_auth and together with ng-token-auth it seems to solve my problem.
So it seems I'll need to learn working with AngularJS for that, but that should be fine.

Which one HTTP gem should I use

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?

Facebook gem for Ruby on Rails

I am going to make a very simple web application. I only need the friend list of the current user and then send a message to a selected user with an image/text. I have looked after gems that wraps the detail of extracting data from Facebook and I found some gems, but they all use the old REST API. First of all: is it bad to use the REST API? If not, is "Facebooker" a good gem? If it is bad I found this Which Ruby gems support the Facebook API? but I don't see much of documentation for the Facebooker2. Are there other options?
i'm using koala - works with OAuth authentication and Facebook Graph API. Didn't have any serious problems with it, and it's pretty well documented (with examples) on github
The Ruby Toolbox is a great resource for this kind of question.
In your case, try searching for 'facebook' -- as in https://www.ruby-toolbox.com/search?utf8=%E2%9C%93&q=facebook -- and you'll find that https://github.com/nov/fb_graph is a popular and well-maintained FB gem (at least riight now).
Since Facebook introduced the Open Graph API I've found it's pretty easy to just roll my own wrapper for the REST calls I need using an http client like HTTParty or RestClient. YMMV.

Rails 3. Building an oauth2 provider

I am developing an API in Ruby on Rails 3 and I would like to secure it with Oauth2.
In other words, I need to create an Oauth provider. Is there a working gem for Rails 3 out there or perhaps a tutorial on the issue?
UPDATE
I know Rails are REST based so I find it very strange that there are no tutorials on how to create a public API and secure it. Does anyone know of any good tutorials. Preferable with oAuth.
Thankful for all help!!
Check out this gem https://github.com/applicake/doorkeeper
It is for Rails 3, the development it's early stages though.
There's also an example app that you take a look and see how the API is done.
http://doorkeeper-provider.herokuapp.com/
I've opensourced an OAuth2 server implementation yesterday.
It's well documented and there is a dashboard to control accesses. Right now I'm searching for somebody who wants to build an engine starting from it, or something cool on top of rack. That's why it is open-source.
https://github.com/intridea/oauth2 is the canonical gem right now for OAuth2 dev. If you are looking for a more complete solution, instead of rolling your own provider code, check out:
https://github.com/songkick/oauth2-provider
https://github.com/freerange/oauth2-provider
But I suggest messing around with the oauth2 gem if you aren't very familiar with the flow so that you can learn it better.
If you are using (or planning to use) devise for authentication, you can use https://github.com/socialcast/devise_oauth2_providable as plugin.
I'm developing a rugygem for OAuth2 provider, Rack::OAuth2.
https://github.com/nov/rack-oauth2
It requires to develop models (token, code, client etc) by yourself, but you can get a whole Rails3 sample OAuth2 server here.
https://github.com/nov/rack-oauth2-sample
I'm looking to implement an OAuth2 provider, too! I'm currently experimenting with this https://github.com/assaf/rack-oauth2-server, which seems to be a full-featured OAuth2 server, though it still supports only MongoDB, although implementing support for other DBMS seems simple enough. I am also looking at some of the other options posted here, lots of promising stuff!
"Doorkeeper is a gem that makes it easy to introduce OAuth 2 provider functionality to your application."
https://github.com/applicake/doorkeeper

Resources