gofr icon indicating copy to clipboard operation
gofr copied to clipboard

Error Authorising while using EnableBasicAuthwithValidator

Open coolwednesday opened this issue 1 year ago • 0 comments

Describe the bug Error while Authorising, using EnableBasicAuthwithValidator. Returns 401, instead of 200.

To Reproduce

  • Create a function of signature : func(c *container.Container, username string, password string) bool
  • Pass it while enabling app.EnableBasicAuthwithValidator(validatefunc).
  • Create a mock request and add correct base64 encoded Authorisation header with "Basic " concatenated such that validateFunc function will return true while the check.
  • hit the request and we get 401 instead of 200.

Expected behavior the validateCredentials function in basic_auth.go must be refactored to handle this use case.

coolwednesday avatar Aug 08 '24 05:08 coolwednesday