1
0
Fork 0
mirror of https://github.com/requarks/wiki.git synced 2026-03-02 22:06:55 -05:00

LDAP Configuration Error #1942

Closed
opened 2026-02-20 18:24:25 -05:00 by deekerman · 11 comments
Owner

Originally created by @alyfilipe on GitHub (Aug 31, 2020).

Question
Hello. We are having difficulty configuring LDAP. We added all the necessary fields and received the error message below when trying to login:

insert into "users" ("createdAt", "email", "isActive", "isSystem", "isVerified", "localeCode", "name", "pictureUrl", "providerId", "providerKey", "tfaIsActive", "updatedAt") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) returning "id" - invalid byte sequence for encoding "UTF8": 0x00

LDAP Debug is enable and self-registration too.

Host Info
OS: [Docker]
Wiki.js version: [2.4.107]
Database engine: [postgres:11-alpine]
LDAP: FreeIPA

Active Configurations:

LDAP URL
ldap://x-x-x-x:389

Admin Bind DN
uid=xxxxx,cn=users,cn=accounts,dc=xxxx,dc=local

Admin Bind Credentials
x-x-x-x

Search Base
cn=users,cn=accounts,dc=xxxx,dc=local

Search Filter
(uid={{username}})

Unique ID Field Mapping
uid

Email Field Mapping
mail

Display Name Field Mapping
cn

Avatar Picture Field Mapping
jpegPhoto

This configuration is functional in many internal systems.

Thanks.

Originally created by @alyfilipe on GitHub (Aug 31, 2020). **Question** Hello. We are having difficulty configuring LDAP. We added all the necessary fields and received the error message below when trying to login: insert into "users" ("createdAt", "email", "isActive", "isSystem", "isVerified", "localeCode", "name", "pictureUrl", "providerId", "providerKey", "tfaIsActive", "updatedAt") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) returning "id" - invalid byte sequence for encoding "UTF8": 0x00 LDAP Debug is enable and self-registration too. **Host Info** OS: [Docker] Wiki.js version: [2.4.107] Database engine: [postgres:11-alpine] LDAP: FreeIPA **Active Configurations**: LDAP URL ldap://x-x-x-x:389 ​ Admin Bind DN uid=xxxxx,cn=users,cn=accounts,dc=xxxx,dc=local ​ Admin Bind Credentials x-x-x-x ​ Search Base cn=users,cn=accounts,dc=xxxx,dc=local ​ Search Filter (uid={{username}}) ​ Unique ID Field Mapping uid ​ Email Field Mapping mail ​ Display Name Field Mapping cn ​ Avatar Picture Field Mapping jpegPhoto This configuration is functional in many internal systems. Thanks.
Author
Owner

@BuhtigithuB commented on GitHub (Sep 2, 2020):

I had difficulty with ldap vs ldapS at first when I try you might make sure you didn't try to authenticate to 389 with ldapS and 636 with ldap... There is also the check box for TLS and for cert TLS to uncheck in case of 389 (ldap)...

Then make sure you user "uid" AD field and not "sAMAccountName"... You seems to user FreeIPA, don't know it and how well support it is...

Finally, I didn't get LDAP authentication working with TLS/LDAPS/636 no verification, yet and I try rely hard...

@BuhtigithuB commented on GitHub (Sep 2, 2020): I had difficulty with ldap vs ldapS at first when I try you might make sure you didn't try to authenticate to 389 with ldapS and 636 with ldap... There is also the check box for TLS and for cert TLS to uncheck in case of 389 (ldap)... Then make sure you user "uid" AD field and not "sAMAccountName"... You seems to user FreeIPA, don't know it and how well support it is... Finally, I didn't get LDAP authentication working with TLS/LDAPS/636 no verification, yet and I try rely hard...
Author
Owner

@alyfilipe commented on GitHub (Sep 3, 2020):

I can't use ldaps. He complains about the self-signed certificate -> "warn: LDAP LOGIN ERROR (c1): self signed certificate in certificate chain"

And using ldap on port 389, it seems to work, but some field goes empty for the bank and gives the mentioned error -> warn: LDAP LOGIN ERROR (c2): update "users" set "email" = $1, "name" = $2, "pictureUrl" = $3, "updatedAt" = $4 where "users"."id" = $5 - invalid byte sequence for encoding "UTF8": 0x00

There is no possibility to work without LDAP. So I'm already selling other wiki alternatives, in case wikijs don't work

@alyfilipe commented on GitHub (Sep 3, 2020): I can't use ldaps. He complains about the self-signed certificate -> "warn: LDAP LOGIN ERROR (c1): self signed certificate in certificate chain" And using ldap on port 389, it seems to work, but some field goes empty for the bank and gives the mentioned error -> warn: LDAP LOGIN ERROR (c2): update "users" set "email" = $1, "name" = $2, "pictureUrl" = $3, "updatedAt" = $4 where "users"."id" = $5 - invalid byte sequence for encoding "UTF8": 0x00 There is no possibility to work without LDAP. So I'm already selling other wiki alternatives, in case wikijs don't work
Author
Owner

@rafacouto commented on GitHub (Sep 4, 2020):

I can confirm the bug reported by @alyfilipe with similar configurations (dockers requarks/wiki:2 and postgres:11) and LDAP / Active Directory authentication module.

Anyway, I think it is not related to LDAP module but the problem seems with postgresql when trying to do auto registration the first time the user is authenticated. I have done a valid installation with mariadb (ldap and ldaps+certificate running OK).

@rafacouto commented on GitHub (Sep 4, 2020): I can confirm the bug reported by @alyfilipe with similar configurations (dockers requarks/wiki:2 and **postgres**:11) and LDAP / Active Directory authentication module. Anyway, I think it is not related to LDAP module but [the problem seems with **postgresql when trying to do auto registration**](https://stackoverflow.com/questions/1347646/postgres-error-on-insert-error-invalid-byte-sequence-for-encoding-utf8-0x0) the first time the user is authenticated. I have done a valid installation with mariadb (ldap and ldaps+certificate running OK).
Author
Owner

@rafacouto commented on GitHub (Sep 4, 2020):

Related: #849

@rafacouto commented on GitHub (Sep 4, 2020): Related: #849
Author
Owner

@rafacouto commented on GitHub (Sep 4, 2020):

Confirmed: it is a problem with Postgresql and the Avatar Picture Field Mapping (maybe with any non existent attribute for the user in the LDAP). It is working now after using displayName (existing attribute for that field):

working mapping

@rafacouto commented on GitHub (Sep 4, 2020): Confirmed: it is a problem with Postgresql and the _Avatar Picture Field Mapping_ (maybe with any non existent attribute for the user in the LDAP). It is working now after using _displayName_ (existing attribute for that field): ![working mapping](https://i.imgur.com/AYlMzP7.png)
Author
Owner

@alyfilipe commented on GitHub (Sep 4, 2020):

Perfect. Using the informed parameter it worked without problems. I appreciate the help

@alyfilipe commented on GitHub (Sep 4, 2020): Perfect. Using the informed parameter it worked without problems. I appreciate the help
Author
Owner

@rafacouto commented on GitHub (Sep 4, 2020):

Well, the problem is just a trick to avoid the fatal error. The bug must be arranged to do the avatar picture mapping...

@rafacouto commented on GitHub (Sep 4, 2020): Well, the problem is just a trick to avoid the fatal error. The bug must be arranged to do the avatar picture mapping...
Author
Owner

@NGPixel commented on GitHub (Sep 6, 2020):

@rafacouto See #849

@NGPixel commented on GitHub (Sep 6, 2020): @rafacouto See #849
Author
Owner

@rafacouto commented on GitHub (Sep 8, 2020):

@NGPixel Why both issues are closed? It is clearly a bug and it should be solved. The explained trick is a bypass to avoid the error with postgresql and auto-registration with the avatar: the postgresql wikijs layer must manage binaries with avatar field or it must be deactivated with this database engine. Do you prefer to open a new one to treat the bug?

@rafacouto commented on GitHub (Sep 8, 2020): @NGPixel Why both issues are closed? It is clearly a bug and it should be solved. The explained trick is a bypass to avoid the error with postgresql and auto-registration with the avatar: the **postgresql wikijs layer must manage binaries with avatar field** or it must be deactivated with this database engine. Do you prefer to open a new one to treat the bug?
Author
Owner

@NGPixel commented on GitHub (Sep 8, 2020):

@rafacouto Have you actually read the last reply #849 or you just assumed it was closed for no reason?

@NGPixel commented on GitHub (Sep 8, 2020): @rafacouto Have you actually read the last reply #849 or you just assumed it was closed for no reason?
Author
Owner

@rafacouto commented on GitHub (Sep 8, 2020):

Sorry, your commit was 11 hours ago and this issue was closed 2 days ago... Updated and tested: it allows autoregister with postgresql 👍

@rafacouto commented on GitHub (Sep 8, 2020): Sorry, your commit was 11 hours ago and this issue was closed 2 days ago... Updated and tested: it allows autoregister with postgresql :+1:
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/wiki-requarks#1942
No description provided.