Ldap authentication

System Information
  • Strapi Version:
  • Operating System:
  • Database:
  • Node Version:
  • NPM Version:
  • Yarn Version:

how do i implement ldap authentication in Strapi.
thanks

LDAP is basically a database, Strapi has a list of supported databases and LDAP is not one of them.

Hey @dubiels86 :wave:,

Do you want to implement this for the end-user or for the Administrators (Admin Panel) ?

I am also interested in this. I would like to use it for end users.

Isn’t there an AD plugin that will work for this?

lDAP auth isn’t possible, as far as I know there are also no plugins/providers for it. There is an issue on GitHub that tracks this feature request: LDAP and CAS authentication support · Issue #2312 · strapi/strapi · GitHub

1 Like

Tailing off the LDAP question with a related question, is it possible to add a user directly to the database?

If so, which fields are the minimum fields that need to populated in order for Strapi to recognize the new user?

Yes, you can add users by using users-permissions services:

await strapi.plugins['users-permissions'].services.user.add({
    blocked: false,
    confirmed: true, 
    username: 'new_username',
    email: 'test@testemail.com',
    password: 'secretpassword', //will be hashed automatically
    provider: 'local', //provider
    created_by: 1, //user admin id
    updated_by: 1, //user admin id
    role: 1 //role id
});

All those from the above example.

2 Likes

Thank you for that example, but I actually want to be able to add the user directly to the database without using a Strapi interface to the DB.

From your example, tt looks like there are at least 8 attributes in one or more database tables and fields that would be affected.

Which tables and fields are actually added?