Better and simpler solution for API authentication in Rails -


I am creating an API and I am stuck in the authentication section. I will try to explain what I have and what I am trying to do:

  • First of all, the API is closed to the public, it is only used on the back-end of the admin and Third party equipment in company
  • I have a model called a model that is being used for the certification with the div
  • I am using STI to differentiate between 3 levels of users

What did I think:

  • I tried token authentication from the rail, it works but I was scared That every Ajax request, I do not know that I was right.
  • I also tried to use a '/ token' route to post my certificate and obtain a token, but I had to face another problem.
  • I do not want to use OAuth because it is unnecessary for that type of application.

Is it safe to use this token authentication with AJAX requests or is there any more safe way to prevent people from accessing my API?

Token authentication is required on a secure connection. For example, if you are using Heroku, it is possible to use your credentials to get the HTTPS url. With this the content will be encrypted and it will be acceptable to expose the token to Tokyo on the API.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -