RocketChat / RocketChat/Rocket.Chat

API Login for ldap synced user does not work until first browser login

Open
#15,299 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: authentication
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

On a fresh setup of rocketchat, bound against an LDAP server, it is not possible to use the api of a user if the user has not logged in via the browser interface first.

Steps to reproduce:
  1. Setup a fresh Rocket.Chat installation with LDAP as user authentication background
  2. Run curl -k http://localhost/chat/api/v1/login -d "user=demouser&password=demouser" as many times as you want - you always get {"status":"error","error":"Unauthorized","message":"Unauthorized"}
  3. Login the user demouser via the browser interface
  4. Run curl -k http://localhost/chat/api/v1/login -d "user=demouser&password=demouser" again you receive {"status":"success","data":{"userId":"ZkEZwgy8vfMbRnvuC","authToken"...
Expected behavior:

The API should be usable without requiring the browser login as a separate step.

Actual behavior:

as described above

Server Setup Information:
  • Version of Rocket.Chat Server: 1.3.2
  • Operating System: Debian Linux 10
  • Deployment Method: Docker

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the API login endpoint /api/v1/login and reproduce the LDAP case with the provided curl request before any browser login. Compare the API login path with the browser login flow; done means an LDAP-synced user receives a successful API login response without first using the browser interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.