Description
In MGW when invoking APIs using malformed base64 encoded basic auth header, the server returns a 500 instead of a 401.
Steps to Reproduce
- First hosted an API by following [1].
- Before deploying the API in the Micro-Gateway runtime, Configured the WSO2 API Microgateway for Basic Authentication using [2].
- Then invoke the
https://localhost:9095/petstore/v1/pet/1 using postman by adding Authorization : Basic YWRtaW46YWRtaW4=. This returned a 200 OK reponse. YWRtaW46YWRtaW4=1 is Base64(admin:admin).
- Then invoke the
https://localhost:9095/petstore/v1/pet/1 again using postman by adding Authorization : Basic YWRtaW46YWRtaW4=1 (malformed basic auth). This returned a 500 Internal Server Error with the below reponse:
[1] : https://mg.docs.wso2.com/en/latest/how-tos/adding-apis/using-an-openapi-definition/
[2] : https://mg.docs.wso2.com/en/latest/how-tos/security/api-authentication/basic-authentication/
Version
WSO2 Microgateway 3.2.0
Environment Details (with versions)
No response
Relevant Log Output
Related Issues
No response
Suggested Labels
No response
Description
In MGW when invoking APIs using malformed base64 encoded basic auth header, the server returns a 500 instead of a 401.
Steps to Reproduce
https://localhost:9095/petstore/v1/pet/1using postman by addingAuthorization : Basic YWRtaW46YWRtaW4=. This returned a200 OKreponse.YWRtaW46YWRtaW4=1isBase64(admin:admin).https://localhost:9095/petstore/v1/pet/1again using postman by addingAuthorization : Basic YWRtaW46YWRtaW4=1(malformed basic auth). This returned a500 Internal Server Errorwith the below reponse:[1] : https://mg.docs.wso2.com/en/latest/how-tos/adding-apis/using-an-openapi-definition/
[2] : https://mg.docs.wso2.com/en/latest/how-tos/security/api-authentication/basic-authentication/
Version
WSO2 Microgateway 3.2.0
Environment Details (with versions)
No response
Relevant Log Output
Related Issues
No response
Suggested Labels
No response