Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1366927

Summary: Wrong error message passed from SSO on password grant type failure
Product: [oVirt] ovirt-engine Reporter: Ravi Nori <rnori>
Component: AAAAssignee: Ravi Nori <rnori>
Status: CLOSED CURRENTRELEASE QA Contact: Gonza <grafuls>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, mgoldboi, mperina, pstehlik
Target Milestone: ovirt-4.0.4Flags: rule-engine: ovirt-4.0.z+
mgoldboi: planning_ack+
mperina: devel_ack+
pstehlik: testing_ack+
Target Release: 4.0.4   
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: 2016-09-26 12:38: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:

Description Ravi Nori 2016-08-15 02:05:20 UTC
Description of problem: When trying to obtain token from SSO using password grant type, if wrong password or username is specified the authentication fails but SSO returns an error message stating that the session has expired.


Version-Release number of selected component (if applicable): 4.0.2


How reproducible: Always


Steps to Reproduce:
1. Obtain token from SSO using password grant type

curl -v -k -H "Accept: application/json" 'http://127.0.0.1:8080/ovirt-engine/sso/oauth/token?grant_type=password&username=admin@internal&password=wrongpasswd&scope=ovirt-app-api'

Actual results:

{"error_code":"invalid_grant","error":"Session expired please try again."}


Expected results:

{"error_code":"access_denied","error":"Cannot authenticate user 'admin@internal': The user name or password is incorrect.."}

Comment 1 Martin Perina 2016-08-16 13:49:19 UTC
Moving back to POST, we need to backport to ovirt-engine-4.0

Comment 2 Gonza 2016-09-13 10:57:32 UTC
Verified with:
rhevm-4.0.3-0.1.el7ev.noarch

{"error_code":"access_denied","error":"Cannot authenticate user 'admin@internal': The user name or password is incorrect.."}