My application used Devise, and API want to support cURL to test like BaseCamp API
curl -u username:password https://app.com/api/v1/test.json
I know how to use token to authentication,but I want to use -u username:password to authentication and return json directly.How to implement?
This nothing to do with Devise, Rails is easy to do HTTP Basic and Digest authentication.HttpAuthentication
The username and password can pass to the ‘u’,’p’ param in the following code: