overture-stack / ego

OAuth 2.0 authorization service that supports multiple OpenID identity providers
https://www.overture.bio/products/ego
GNU Affero General Public License v3.0
25 stars 14 forks source link

BUG - EGO : All Admin access api's should not return HTTP 400 when invalid or not provided #708

Open Azher2Ali opened 1 year ago

Azher2Ali commented 1 year ago

EGO : All Admin access api's should not return HTTP 400 when api key is not provided or invalid and should return HTTP 401

Description

EGO : All Admin access api's should not return HTTP 400 when api key is not provided or invalid and should return HTTP 401. Also invalid jwt should return 401, valid jwt but wrong credentials (ie. not admin) should return 403

Expected Behaviour

All Admin access api's in ego should return HTTP 401 Unauthorized when api key is not provided or is invalid.

Actual Behaviour

All Admin access api's in ego is returning HTTP 400 Bad Request when an api key is not provided or is invalid.

Sample response { "timestamp": "2023-05-26T14:32:48.744+0000", "status": 400, "error": "Bad Request", "path": "/visa" }

Possible Fix

Need to compare with older ego version to check the difference in changes done during Spring version upgrade for OAuth2SecurityRequestResolver

Steps to Reproduce

  1. Go to 'https://ego-passport.dev.cancogen.cancercollaboratory.org/swagger-ui/index.html'
  2. Do not provide any api key in "Authorize" tab.
  3. Test any api within ego
  4. Response returned is HTTP 400 Bad Request