Faraday: RuntimeError: :basic_authentication is not registered on Faraday::Request

Created on 14 Apr 2013  路  1Comment  路  Source: lostisland/faraday

conn = Faraday.new(url: "https://example.com/something") do |faraday|
  faraday.adapter  :net_http
  faraday.request  :basic_authentication
end
RuntimeError: :basic_authentication is not registered on Faraday::Request
from /Users/dukejones/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/faraday-0.8.7/lib/faraday.rb:64:in `lookup_middleware'

This was working great at 3 in the morning. At 4am it stopped working. I didn't update the gem, not sure what I changed. I see Faraday::Request::BasicAuthentication in the source tree. In fact, the same thing happens with:

conn = Faraday.new(url: "https://example.com/something") do |faraday|
  faraday.adapter  :net_http
  faraday.request  Faraday::Request::BasicAuthentication
end

It works fine with Faraday::Request::Authorization.

conn = Faraday.new(url: "https://example.com/something") do |faraday|
  faraday.adapter  :net_http
  faraday.request  :authorization
end

Any ideas?

In the meantime I'll manually Base64 encode my token, but I'd really like to know what's going wrong here.

Most helpful comment

What version of Faraday? Pretty sure the key name is :basic_auth, not :basic_authorization.

https://github.com/lostisland/faraday/blob/v0.8.7/lib/faraday/request.rb#L30

>All comments

What version of Faraday? Pretty sure the key name is :basic_auth, not :basic_authorization.

https://github.com/lostisland/faraday/blob/v0.8.7/lib/faraday/request.rb#L30

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lewiscowles1986 picture Lewiscowles1986  路  4Comments

jordansissel picture jordansissel  路  5Comments

amrrbakry picture amrrbakry  路  4Comments

mvastola picture mvastola  路  4Comments

mattmill30 picture mattmill30  路  4Comments