[GH-ISSUE #1147] [FEATURE REQUEST] GraphQL endpoint to change password without opaque-ke #408

Open
opened 2026-02-27 08:17:08 +03:00 by kerem · 9 comments
Owner

Originally created by @spikeyspik on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/lldap/lldap/issues/1147

Motivation
I recently integrated an LLDAP server with my application to create users programmatically from another system. I did everything entirely through the GraphQL API, but in the end, I encountered an issue: I could not change the password using the API because there is no PHP implementation of opaque-ke protocol. I had to use the LDAP protocol solely for this purpose, which is not an ideal solution.

Describe the solution you'd like
An easy GraphQL endpoint to change passwords using cleartext or another method.

Originally created by @spikeyspik on GitHub (Apr 3, 2025). Original GitHub issue: https://github.com/lldap/lldap/issues/1147 **Motivation** I recently integrated an LLDAP server with my application to create users programmatically from another system. I did everything entirely through the GraphQL API, but in the end, I encountered an issue: I could not change the password using the API because there is no PHP implementation of opaque-ke protocol. I had to use the LDAP protocol solely for this purpose, which is not an ideal solution. **Describe the solution you'd like** An easy GraphQL endpoint to change passwords using cleartext or another method.
Author
Owner

@nitnelave commented on GitHub (Apr 3, 2025):

You can call the binary "lldap_set_user_password" (or something similar) provided in the docker image for that purpose.

The lack of "simple" endpoint to set the password is intentional, since the password would be sent in plaintext over a potentially unencrypted connection.

<!-- gh-comment-id:2776343993 --> @nitnelave commented on GitHub (Apr 3, 2025): You can call the binary "lldap_set_user_password" (or something similar) provided in the docker image for that purpose. The lack of "simple" endpoint to set the password is intentional, since the password would be sent in plaintext over a potentially unencrypted connection.
Author
Owner

@spikeyspik commented on GitHub (Apr 3, 2025):

I do understand this concern, it's a point.

But at the same time I'm able to change password using unencrypted LDAP connection if I remember correctly.
Maybe consider opportunity to implement method for rewrite hash? Also it will be handy for migration from other platforms

<!-- gh-comment-id:2776432597 --> @spikeyspik commented on GitHub (Apr 3, 2025): I do understand this concern, it's a point. But at the same time I'm able to change password using unencrypted LDAP connection if I remember correctly. Maybe consider opportunity to implement method for rewrite hash? Also it will be handy for migration from other platforms
Author
Owner

@nitnelave commented on GitHub (Apr 3, 2025):

Well, I can't change the LDAP protocol :)

And you're more likely to expose http than LDAP over the internet. You also have the option to use LDAPS which is supported out of the box, but HTTPS is not supported by LLDAP and instead should be handled by an external proxy.
It's easier to mess up :)
(You could argue that we provide a simple, plaintext login option for scripting, but if you're scripting you should be aware of HTTPS)

I don't know, I can't provide perfect protection, I'm just trying to put roadblocks to make you think twice about doing something insecure

<!-- gh-comment-id:2776442395 --> @nitnelave commented on GitHub (Apr 3, 2025): Well, I can't change the LDAP protocol :) And you're more likely to expose http than LDAP over the internet. You also have the option to use LDAPS which is supported out of the box, but HTTPS is not supported by LLDAP and instead should be handled by an external proxy. It's easier to mess up :) (You could argue that we provide a simple, plaintext login option for scripting, but if you're scripting you should be aware of HTTPS) I don't know, I can't provide perfect protection, I'm just trying to put roadblocks to make you think twice about doing something insecure
Author
Owner

@spikeyspik commented on GitHub (Apr 8, 2025):

Sure thing. I just want to avoid situation when you can't do everything you need using only 1 protocol.

I'm not familiar with either Rust or implemented password storage format but I suppose it's some sort of password hash. Can we do an endpoint to rewrite this hash without exposing plaintext password?

<!-- gh-comment-id:2785742137 --> @spikeyspik commented on GitHub (Apr 8, 2025): Sure thing. I just want to avoid situation when you can't do everything you need using only 1 protocol. I'm not familiar with either Rust or implemented password storage format but I suppose it's some sort of password hash. Can we do an endpoint to rewrite this hash without exposing plaintext password?
Author
Owner

@nitnelave commented on GitHub (Apr 8, 2025):

Not really. It's a zero knowledge proof that requires support in both the client and server. Moreover, it's stuck on a draft version of a library that has made breaking changes to the storage format since, so upgrading it would reset all the passwords.

The best I can do is provide a statically linked binary that is easy to call (or LDAP)

<!-- gh-comment-id:2785750910 --> @nitnelave commented on GitHub (Apr 8, 2025): Not really. It's a zero knowledge proof that requires support in both the client and server. Moreover, it's stuck on a draft version of a library that has made breaking changes to the storage format since, so upgrading it would reset all the passwords. The best I can do is provide a statically linked binary that is easy to call (or LDAP)
Author
Owner

@spikeyspik commented on GitHub (Apr 8, 2025):

This is very sad story 😁

How about make cleartext endpoint, but enable it only if special environment variable is set? If it is not - return error with lecture why you should use HTTPS and link to page with further instructions and disclaimers. Can do same thing for scripting simple login.

<!-- gh-comment-id:2785846587 --> @spikeyspik commented on GitHub (Apr 8, 2025): This is very sad story 😁 How about make cleartext endpoint, but enable it only if special environment variable is set? If it is not - return error with lecture why you should use HTTPS and link to page with further instructions and disclaimers. Can do same thing for scripting simple login.
Author
Owner

@nitnelave commented on GitHub (Apr 8, 2025):

Hmm, at this point, the problem becomes that LLDAP doesn't support HTTPS, so we can't ask the user to enable it. If we did have HTTPS, I can picture gating this API endpoint behind it.

<!-- gh-comment-id:2785926648 --> @nitnelave commented on GitHub (Apr 8, 2025): Hmm, at this point, the problem becomes that LLDAP doesn't support HTTPS, so we can't ask the user to enable it. If we did have HTTPS, I can picture gating this API endpoint behind it.
Author
Owner

@spikeyspik commented on GitHub (Apr 8, 2025):

This approach won't solve my use case because I use LLDAP behind nginx with https enabled.
Only if we can use something like x-forwarded-proto header... Which can be used to easily fool application if you know what you're doing 😁

<!-- gh-comment-id:2785935622 --> @spikeyspik commented on GitHub (Apr 8, 2025): This approach won't solve my use case because I use LLDAP behind nginx with https enabled. Only if we can use something like x-forwarded-proto header... Which can be used to easily fool application if you know what you're doing 😁
Author
Owner

@nitnelave commented on GitHub (Apr 8, 2025):

There's also a ticket about SSO/trusted headers.

Coming back to your use case, why can't you call the provided binary?

<!-- gh-comment-id:2786050066 --> @nitnelave commented on GitHub (Apr 8, 2025): There's also a ticket about SSO/trusted headers. Coming back to your use case, why can't you call the provided binary?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#408
No description provided.