Project

General

Profile

Actions

Bug #3025

closed

Supplying no HTTP auth credentials results in server error

Added by Dominic Cleal over 11 years ago. Updated over 11 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Authentication
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

An error in the controller is showing up when accessing the API without supplying any credentials for HTTP auth.

$ curl -s -H 'Accept: application/json' http://0.0.0.0:3000/api/hosts | json_reformat 
{
    "error": {
        "message": "undefined method `user' for nil:NilClass" 
    }
}
Started GET "/api/hosts" for 127.0.0.1 at 2013-09-04 20:47:42 +0100
Processing by Api::V1::HostsController#index as JSON
undefined method `user' for nil:NilClass (NoMethodError)
/home/dcleal/code/foreman/foreman/app/controllers/api/base_controller.rb:81:in `authorize'

Related issues 1 (0 open1 closed)

Has duplicate Foreman - Bug #2855: API authentication controller does not fail gracefullyClosedOhad Levy07/29/2013Actions
Actions

Also available in: Atom PDF