mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Return errInvalidCredentials when wrong credentials is provided for existent users (#17104)
* adding errInvalidCredentials * fixing tests * add changelog * fixing fmt errors * test if routeErr is seen externally and fixing error comment * adding fmt changes * adding comments
This commit is contained in:
@@ -107,7 +107,7 @@ func (b *backend) Login(ctx context.Context, req *logical.Request, username stri
|
||||
if b.Logger().IsDebug() {
|
||||
b.Logger().Debug("ldap bind failed", "error", err)
|
||||
}
|
||||
return "", nil, logical.ErrorResponse(errUserBindFailed), nil, nil
|
||||
return "", nil, logical.ErrorResponse(errUserBindFailed), nil, logical.ErrInvalidCredentials
|
||||
}
|
||||
|
||||
// We re-bind to the BindDN if it's defined because we assume
|
||||
@@ -117,7 +117,7 @@ func (b *backend) Login(ctx context.Context, req *logical.Request, username stri
|
||||
if b.Logger().IsDebug() {
|
||||
b.Logger().Debug("error while attempting to re-bind with the BindDN User", "error", err)
|
||||
}
|
||||
return "", nil, logical.ErrorResponse("ldap operation failed: failed to re-bind with the BindDN user"), nil, nil
|
||||
return "", nil, logical.ErrorResponse("ldap operation failed: failed to re-bind with the BindDN user"), nil, logical.ErrInvalidCredentials
|
||||
}
|
||||
if b.Logger().IsDebug() {
|
||||
b.Logger().Debug("re-bound to original binddn")
|
||||
|
||||
Reference in New Issue
Block a user