Bug #3280
closed
API gives errors when user logins are turned off
Added by Lukas Zapletal about 11 years ago.
Updated over 6 years ago.
Description
Configure foreman with login: false, try hammer:
undefined method `user' for nil:NilClass (NoMethodError)
/home/lzap/work/foreman/app/controllers/api/base_controller.rb:81:in `authorize'
/home/lzap/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:420:in `block (2 levels) in _run__3776958164675687506__process_action__3032593481822066504__callbacks'
/home/lzap/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_1291'
/home/lzap/work/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
/home/lzap/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_1291'
- Target version deleted (
1.4.0)
- Project changed from Foreman to Hammer CLI
- Category deleted (
44)
- Project changed from Hammer CLI to Foreman
- Subject changed from Hammer does not work against foreman with login turned off to API gives errors when user logins are turned off
- Category set to API
This is currently failing from the Foreman side, API requests return 401 Unauthorized when login:false.
From Hammer this is seen like: "Invalid username or password", or "RestClient::Unauthorized (401 Unauthorized):" if --verbose is set. That sounds good to me.
Curl or any other API clients will get also "{"message":"Unable to authenticate user "}".
Maybe after it's fixed in Foreman it'll still fail in Hammer though!
- Status changed from New to Ready For Testing
- Assignee set to Daniel Lobato Garcia
- Target version set to 1.9.3
- Translation missing: en.field_release set to 2
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF