Bug 1558525

Summary: show proper error when authorization to api fails
Product: [oVirt] ovirt-engine Reporter: Lucie Leistnerova <lleistne>
Component: AAAAssignee: Ravi Nori <rnori>
Status: CLOSED CURRENTRELEASE QA Contact: Pavol Brilla <pbrilla>
Severity: low Docs Contact:
Priority: low    
Version: 4.2.2CC: bugs, lsvaty, mgoldboi, mperina
Target Milestone: ovirt-4.2.3Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-10 06:30:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lucie Leistnerova 2018-03-20 12:12:55 UTC
Description of problem:
When authorization to rest api failed, error in response body contains 'null'. It shouldn't be there or some meaningful string instead.

e.g.:
Cannot authenticate user 'test@internal': The username or password is incorrect..: null
Cannot authenticate user 'test_pass@internal': Unable to log in because the password has expired. &amp;lt;a href='/ovirt-engine/sso/credentials-change.html'&amp;gt;Change the password&amp;lt;/a&amp;gt; to proceed..: null

Version-Release number of selected component (if applicable):
ovirt-engine-restapi-4.2.2.4-0.1.el7.noarch

How reproducible: always


Steps to Reproduce:
1. try to connect to api with wrong password
# curl -k -u 'admin@internal:wrongpassword' -H "Prefer: persistent-auth" https://engine/ovirt-engine/api


Actual results: <html><head><title>Error</title></head><body>Cannot authenticate user 'test@internal': The username or password is incorrect..: null</body></html>


Expected results: without ': null'

Comment 1 Pavol Brilla 2018-04-19 10:59:30 UTC
null removed from answer

# yum list ovirt-engine-restapi
Loaded plugins: product-id, search-disabled-repos, versionlock
Installed Packages
ovirt-engine-restapi.noarch                         4.2.3.2-0.1.el7


<html><head><title>Error</title></head><body>access_denied: Cannot authenticate user 'admin@internal': Unable to log in. Verify your login information or contact the system administrator..</body></html>

Comment 2 Sandro Bonazzola 2018-05-10 06:30:08 UTC
This bugzilla is included in oVirt 4.2.3 release, published on May 4th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.3 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.