On Wednesday, June 13, 2012 at 4:36 AM, Horace Ho wrote:
Currently, devise is configured to accept token authentication via URL and curl works well:
curl 'http://localhost/index.json?auth_token=TOKENVALUE'
I'd like to pass the TOKENVALUE via HTTP header instead of URL, how can I config devise to get the TOKENVALUE from HTTP header? Such that the following curl requests will also work:
curl 'http://localhost/index.json' -H 'Authorization: Token token="TOKENVALUE"'
Devise settings in user.rb:
devise :token_authenticatable, :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable