Skip to content

API login doesn't work with an LDAP user when "Login Fallback" parameter is False #7642

@AceSlash

Description

@AceSlash

Description:

Configure LDAP auth with "Login Fallback" parameter to False.

Log yourself with a valid user normally to validate that the user/pass is valid.

Use the same user/pass to perform an API authentication:

curl -H "Content-type:application/json" http://localhost:3000/api/v1/login -d '{ "username": "supervisor", "password": "xxxxxxx" }'
{
  "status": "error",
  "message": "Unauthorized"
}

Change the "Login Fallback" parameter to True, then log yourself again on the web interface with the same user to store the password in the local database, you then set the "Login Fallback" parameter to False again, it doesn't mater.

The authentication will now work with the same login/pass:

curl -H "Content-type:application/json" http://localhost:3000/api/v1/login -d '{ "username": "supervisor", "password": "xxxxxxx" }'
{
  "status": "success",
  "data": {
    "authToken": "KJQhGtdtBb0ecSn3CUQCpCWNUB6nVhpA226GEMM_72M",
    "userId": "tkBC5AEQvDLZ5SqNc"
  }
}

The API should ask LDAP when a user tries to use it and LDAP is active.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.57.2
  • Operating System: Ubuntu 16.04
  • Deployment Method(snap/docker/tar/etc): tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: no
  • Node Version: 4.5.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions