Ruby on Rails

Rails 5 API Authetication

Authentication with Rails authenticate_with_http_token

authenticate_with_http_token do |token, options|
  @user = User.find_by(auth_token: token)
end

You can test this endpoint with curl by making a request like

curl -IH "Authorization: Token token=my-token" https://localhost:3000

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow