LDAP Authentication Issue

Hello,
I need help with configuring the ldap-auth plugin for authentication in peertube. I have a test user with dn
« cn=author test12,ou=people,dc=example,dc=com ».

My current settings:

*** Bind DN: « cn=admin,dc=example,dc=com »**
*** Search base: « dc=example,dc=com »**
*** Search filter: « uid={{username}} »**
*** Group base: « dc=example,dc=com »**
*** Group filter: « objectClass=* »**

When I try to authenticate with the credentials for the user
« cn=author test12,ou=people,dc=example,dc=com », I get the error:

« invalid_grant: Invalid grant: user credentials are invalid »

But this credentials for this user are valid.

Analysis of the traffic log shows the following actions:

  1. Bind as « cn=admin,dc=example,dc=com » - successful
  2. Search for user « cn=author test12,ou=people,dc=example,dc=com » - successful
  3. Bind as « cn=author test12,ou=people,dc=example,dc=com » - successful

But ultimately, PeerTube is not able to authenticate the user. Could you please help me troubleshoot this issue?

Can you provide server logs to see what happens?

2024-06-14 08:34:31.193 error: internal {
peertube-peertube-1 | « result »: {
peertube-peertube-1 | « url »: « ldap://ps.ura.news »,
peertube-peertube-1 | « insecure-tls »: false,
peertube-peertube-1 | « bind-dn »: « cn=admin,dc=example,dc=com »,
peertube-peertube-1 | « bind-credentials »: «  »,
peertube-peertube-1 | « custom-ca »: «  »,
peertube-peertube-1 | « search-base »: "dc=example,dc=com,
peertube-peertube-1 | « search-filter »: « uid={{username}} »,
peertube-peertube-1 | « mail-property »: « mail »,
peertube-peertube-1 | « mail-property-index »: « 0 »,
peertube-peertube-1 | « username-property »: « uid »,
peertube-peertube-1 | « group-base »: « dc=example,dc=com »,
peertube-peertube-1 | « group-filter »: « objectClass=* »,
peertube-peertube-1 | « group-admin »: «  »,
peertube-peertube-1 | « group-mod »: «  »,
peertube-peertube-1 | « group-user »: «  »
peertube-peertube-1 | }
peertube-peertube-1 | }

2024-06-14 08:43:40.865 warn: Login error {
peertube-peertube-1 | « err »: {
peertube-peertube-1 | « stack »: « invalid_grant: Invalid grant: user credentials are invalid\n at handlePasswordGrant (file:///app/dist/core/lib/auth/oauth.js:112:15)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async handleToken (file:///app/dist/core/controllers/api/users/token.js:32:23) »,
peertube-peertube-1 | « message »: « Invalid grant: user credentials are invalid »,
peertube-peertube-1 | « statusCode »: 400,
peertube-peertube-1 | « status »: 400,
peertube-peertube-1 | « code »: 400,
peertube-peertube-1 | « name »: « invalid_grant »
peertube-peertube-1 | }
peertube-peertube-1 | }
peertube-peertube-1 | 2024-06-14 08:43:40.868 info: 192.168.97.91 - - [14/Jun/2024:08:43:40 +0000] « POST /api/v1/users/token HTTP/1.0 » 400 325 « Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0 »
peertube-peertube-1 | 2024-06-14 08:43:40.895 error: Client log: Backend returned code 400, errorMessage is: Invalid grant: user credentials are invalid {

Can you also provide debug logs, especially the lines when you restart peertube? See Logs | PeerTube documentation to update your configuration to enable debug logs

Thanks for your support. The problem was in the ldap account settings.