Bug 1414083

Summary: User Name required for login on behalf
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, mperina
Target Milestone: ovirt-4.1.1Flags: rule-engine: ovirt-4.1+
Target Release: 4.1.1   
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: 2017-04-21 09:38:03 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 Ravi Nori 2017-01-17 17:15:02 UTC
Description of problem:

If user name is missing in login on behalf request, SSO should respond back with a proper error message

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


How reproducible:


Steps to Reproduce:
1. curl -v -k -H "Accept: application/json" 'http://127.0.0.1:8080/ovirt-engine/sso/oauth/token?grant_type=password&username2=admin@internal&password=1&client_id=ovirt-engine&client_secret=secret&scope=ovirt-ext=token:login-on-behalf'

Actual results:
{"error_code":"server_error","error":null}

Expected results:
{"error_code":"invalid_request","error":"Invalid request, parameter 'username' not found or contains invalid value."}

Comment 1 Gonza 2017-03-06 08:20:06 UTC
Verified with:
rhevm-4.1.1-0.1.el7.noarch

curl -k -v -H "Accept: application/json" 'https://ge2.redhat.com/ovirt-engine/sso/oauth/token?grant_type=password&username2=admin@internal&password=1&client_id=ovirt-engine&client_secret=secret&scope=ovirt-ext=token:login-on-behalf'
...
* Connection #0 to host ge2.redhat.com left intact
{"error_code":"invalid_request","error":"Invalid request, parameter 'username' not found or contains invalid value."}%

Comment 2 Gonza 2017-03-06 08:20:07 UTC
Verified with:
rhevm-4.1.1-0.1.el7.noarch

curl -k -v -H "Accept: application/json" 'https://ge2.redhat.com/ovirt-engine/sso/oauth/token?grant_type=password&username2=admin@internal&password=1&client_id=ovirt-engine&client_secret=secret&scope=ovirt-ext=token:login-on-behalf'
...
* Connection #0 to host ge2.redhat.com left intact
{"error_code":"invalid_request","error":"Invalid request, parameter 'username' not found or contains invalid value."}%