Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Normal
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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'
Actions #1

Updated by Greg Sutcliffe about 11 years ago

  • Target version deleted (1.4.0)
Actions #2

Updated by Dominic Cleal about 11 years ago

  • Project changed from Foreman to Hammer CLI
  • Category deleted (44)
Actions #3

Updated by Dominic Cleal about 11 years ago

  • 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
Actions #4

Updated by Daniel Lobato Garcia about 11 years ago

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!

Actions #6

Updated by Dominic Cleal about 11 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Daniel Lobato Garcia
  • Target version set to 1.9.3
Actions #7

Updated by Dominic Cleal about 11 years ago

  • Translation missing: en.field_release set to 2
Actions #8

Updated by Daniel Lobato Garcia about 11 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF