With clients in LDAP you can't add/configure Glewlwyd OpenID Connect Plugin #81

Closed
opened 2020-01-03 13:50:58 +01:00 by rurus9 · 6 comments
rurus9 commented 2020-01-03 13:50:58 +01:00 (Migrated from github.com)

Describe the issue
When you add LDAP backend client module (valid one!), after logout/login in you can't add/configure Glewlwyd OpenID Connect Plugin.
I set log lovel to DEBUG, but logs are produced only when ldap is misconfigured:

2020-01-03T12:32:04 - Glewlwyd ERROR: connect_ldap_server client - Error binding to ldap server mode (null): Can't contact LDAP server
2020-01-03T12:32:04 - Glewlwyd ERROR: client_module_count_total ldap - Error connect_ldap_server

To Reproduce
Add proper configured LDAP backend client module (you can list LDAP clients in Gwelwyd frontend), logout from Gwelwyd, log in and go to Parameters/Plugins and try to add/reconfigure Glewlwyd OpenID Connect Plugin.
(When LDAP backend is not working - ex. misconfigured - after relogin you can work with Glewlwyd OpenID Connect Plugin).

Expected behavior
You can add/reconfigure OID plugin with working LDAP Clients plugin.

Screenshots
Issue_no_OID

System (please complete the following information):

  • OS/Environment [Debian bullseye]
  • Browser used [68.3.0esr]
  • Glewlwyd Version [oficcial docker 2.0.0 and docker made from source from 20200102]
**Describe the issue** When you add LDAP backend client module (valid one!), after logout/login in you can't add/configure Glewlwyd OpenID Connect Plugin. I set log lovel to DEBUG, but logs are produced only when ldap is misconfigured: ``` 2020-01-03T12:32:04 - Glewlwyd ERROR: connect_ldap_server client - Error binding to ldap server mode (null): Can't contact LDAP server 2020-01-03T12:32:04 - Glewlwyd ERROR: client_module_count_total ldap - Error connect_ldap_server ``` **To Reproduce** Add proper configured LDAP backend client module (you can list LDAP clients in Gwelwyd frontend), logout from Gwelwyd, log in and go to Parameters/Plugins and try to add/reconfigure Glewlwyd OpenID Connect Plugin. (When LDAP backend is not working - ex. misconfigured - after relogin you can work with Glewlwyd OpenID Connect Plugin). **Expected behavior** You can add/reconfigure OID plugin with working LDAP Clients plugin. **Screenshots** ![Issue_no_OID](https://user-images.githubusercontent.com/46960652/71724220-c9ab2a80-2e2f-11ea-82b4-767ccd8c2d57.png) **System (please complete the following information):** - OS/Environment [Debian bullseye] - Browser used [68.3.0esr] - Glewlwyd Version [oficcial docker 2.0.0 and docker made from source from 20200102]
babelouest commented 2020-01-03 22:01:15 +01:00 (Migrated from github.com)

Hello @rurus9 ,

Thanks for reporting the issue. While I was trying to reproduce it, I found other bugs in the client LDAP backend so I fixed them too, it could led to glewlwyd crash in some cases...

Your initial problem is weird because I was able to reproduce it, but I couldn't exactly pinpoint why. The main reason is that the scopes list is undefined, the reason why is that the fetchAllScopes() function hasn't been called or hasn't finished executing. I made a workaround in this commit to avoid this error message.

The funny thing is that your problem isn't strictly related to the LDAP backend, but maybe getting clients from the LDAP backend takes too much time so that's how the error appeared.

Anyway, I'm too verbose here... Can you try with the last commit to see if the problem remains?

Hello @rurus9 , Thanks for reporting the issue. While I was trying to reproduce it, I found other bugs in the client LDAP backend so I fixed them too, it could led to glewlwyd crash in some cases... Your initial problem is weird because I was able to reproduce it, but I couldn't exactly pinpoint why. The main reason is that the scopes list is `undefined`, the reason why is that the `fetchAllScopes()` function hasn't been called or hasn't finished executing. I made a workaround in this [commit](https://github.com/babelouest/glewlwyd/commit/1f41fc308b4a797cc1e0738fb56ba5dab64482ca) to avoid this error message. The funny thing is that your problem isn't strictly related to the LDAP backend, but maybe getting clients from the LDAP backend takes too much time so that's how the error appeared. Anyway, I'm too verbose here... Can you try with the [last commit](https://github.com/babelouest/glewlwyd/commit/881cb1197a065885f86b3680cfda150cd16474ce) to see if the problem remains?
rurus9 commented 2020-01-07 12:20:34 +01:00 (Migrated from github.com)

No luck with LDAP backend client module.
I built today docker (git pull; make docker).
It's clear installation, I use built-in SQLite database backend.
With this docker image, I can't enable "LDAP backend client module" at all.

When adding "LDAP backend client module" instance (after completion all fields) I see error "Error while adding module" and message message about few mandatory fields (which I completed), and the same info I can see in logs:

2020-01-07T10:52:02 - Glewlwyd ERROR: user_module_init database - Error parsing parameters
2020-01-07T10:52:02 - Glewlwyd ERROR: ["client_id-property is mandatory and must be a non empty string","scope-property is mandatory and must be a non empty string","name-property is mandatory and must be a non empty string","description-property is optional and must be a non empty string","confidential-property is mandatory and must be a non empty string"]

Enabled is set to "No".
When I try set Enabled to "Yes", I see the error message "Error while updating module" (and the same logs like with adding).

Did you notice "Glewlwyd ERROR: user_module_init database" in first line on log? Shouldn't it be " client_module_init"?

Add_LDAP_client_Error

No luck with LDAP backend client module. I built today docker (git pull; make docker). It's clear installation, I use built-in SQLite database backend. With this docker image, I can't enable "LDAP backend client module" at all. When adding "LDAP backend client module" instance (after completion all fields) I see error "Error while adding module" and message message about few mandatory fields (which I completed), and the same info I can see in logs: ``` 2020-01-07T10:52:02 - Glewlwyd ERROR: user_module_init database - Error parsing parameters 2020-01-07T10:52:02 - Glewlwyd ERROR: ["client_id-property is mandatory and must be a non empty string","scope-property is mandatory and must be a non empty string","name-property is mandatory and must be a non empty string","description-property is optional and must be a non empty string","confidential-property is mandatory and must be a non empty string"] ``` Enabled is set to "No". When I try set Enabled to "Yes", I see the error message "Error while updating module" (and the same logs like with adding). Did you notice "Glewlwyd ERROR: user_module_init database" in first line on log? Shouldn't it be " client_module_init"? ![Add_LDAP_client_Error](https://user-images.githubusercontent.com/46960652/71891936-020c7a80-3148-11ea-8036-2ecbfa6896fd.png)
babelouest commented 2020-01-07 13:08:55 +01:00 (Migrated from github.com)

Is it a new LDAP backend you just created or an previous one? These errors look weird, as if the parameters are corrupted.

Concerning the word "user" in the client module, thanks for noticing, I'll make a cleanup.

Is it a new LDAP backend you just created or an previous one? These errors look weird, as if the parameters are corrupted. Concerning the word "user" in the client module, thanks for noticing, I'll make a cleanup.
rurus9 commented 2020-01-07 13:35:16 +01:00 (Migrated from github.com)

Its a new, fresh docker instance, without additional configs (with default built-in SQLite database).
You can save "LDAP backend client module" config, so all required fields are filled (without it you can't save config).
Yes, it's weird...

Its a new, fresh docker instance, without additional configs (with default built-in SQLite database). You can save "LDAP backend client module" config, so all required fields are filled (without it you can't save config). Yes, it's weird...
babelouest commented 2020-01-08 02:01:42 +01:00 (Migrated from github.com)

Hello,

This should be fixed in github.com/babelouest/glewlwyd@8c9fdbf172 , it was an issue with readonly modules...
Can you check again with the last commit in master?

Hello, This should be fixed in https://github.com/babelouest/glewlwyd/commit/8c9fdbf1728f10f2b11f89c72dbc41e0fedb120e , it was an issue with readonly modules... Can you check again with the last commit in master?
rurus9 commented 2020-01-08 09:16:03 +01:00 (Migrated from github.com)

It looks good, now I can configure/add OID plugin with LDAP clients active.
Thank you.

It looks good, now I can configure/add OID plugin with LDAP clients active. Thank you.
This discussion has been locked. Commenting is limited to contributors.
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
KittenSquad/glewlwyd#81
No description provided.