Bug 758813

Summary: Error message for unauthorized access to API when in Katello OAuth mode is misleading
Product: Red Hat Satellite Reporter: Mike McCune <mmccune>
Component: InstallerAssignee: Lukas Zapletal <lzap>
Status: CLOSED UPSTREAM QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bkearney
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 894390 (view as bug list) Environment:
Last Closed: 2013-09-19 18:09:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 894390    
Attachments:
Description Flags
Patch taken from the pull request. none

Description Mike McCune 2011-11-30 18:37:02 UTC
If you have Candlepin setup to use OAuth for Katello:

module.config.katello=org.fedoraproject.candlepin.katello.KatelloModule
candlepin.auth.oauth.enabled = true

and try to access the webservice API with something like curl you get a misleading error message:

$ curl -k -u admin:admin https://somebox.example.com:8443/candlepin/status

{"displayMessage":"Error contacting user service"}

ideally this would say something like:

{"displayMessage":"Candlepin is configured for OAuth access only, username and password not allowed."}

Comment 1 Bryan Kearney 2012-12-13 21:37:13 UTC
This is due to basic auth being enabled in the katello install. Full information can be seen at:

https://github.com/Katello/katello/pull/1256

I am moving this to the installer component of System Engine.

Comment 2 Bryan Kearney 2012-12-13 21:39:02 UTC
Created attachment 663207 [details]
Patch taken from the pull request.

Comment 3 Lukas Zapletal 2012-12-18 16:01:30 UTC
Ok I will test this for you :-)

Comment 4 Lukas Zapletal 2012-12-19 11:31:27 UTC
Merged the https://github.com/Katello/katello/pull/1256

Comment 5 Bryan Kearney 2013-01-25 18:57:54 UTC
commit ba2d5131de181dcffc833aeb80ea3fde55754a55
Author: Bryan Kearney <bkearney>
Date:   Thu Dec 13 16:30:19 2012 -0500

    758813: Disable basic and trusted auth in the candlepin engine since it is not required.
    
    This manifested as an an error seen by curl which when using basic auth there was an error
    contacting the user service. Basic auth should never be used. With these settings, the output
    is
    
    [root@samdev ~]# curl -k -u admin:admin https://localhost:8443/candlepin/owners
    {"displayMessage":"Invalid credentials."}
    
    Note, this will make development harder since people may use curl to access candlepin.
    Developers can set these to true and then restart candlepin

Comment 6 Mike McCune 2013-09-19 18:09:38 UTC
These bugs have been resolved in upstream projects for a period of months so I'm mass-closing them as CLOSED:UPSTREAM.  If this is a mistake feel free to re-open.