Code Monkey home page Code Monkey logo

Comments (5)

Crim avatar Crim commented on May 29, 2024

Hey thanks for bringing this up, as I'm not super familiar w/ LDAP. Basically what you're describing is a flow that looks like:

  • User enters credentials in web app
  • Server takes those credentials and attempts to bind/connect to LDAP using them.
  • If LDAP rejects the credentials, user is NOT authenticated.
  • If LDAP accepts the credentials, user IS authenticated.

Is there typically any additional steps made to retrieve details about the user and the groups associated with the user?

from kafka-webview.

maximann avatar maximann commented on May 29, 2024

Thanks for getting back so quickly. I'm no LDAP expert myself, I just tried to integrate webview with our server and came across the problem here. The flow you describe is accurate. My impression is that during the bind process additional details about the user can be retrieved such as group membership.

From my current understanding, one important thing is that "ldaps://" is used when sending passwords in plaint text, and the LDAP server needs to be setup to support this.

It sounds like spring supports this process natively, I found the following two resources:
https://docs.spring.io/spring-security/site/docs/3.0.x/reference/ldap.html
https://stackoverflow.com/questions/5255158/spring-ldap-bind-for-successful-connection

All this being said, I don't know much about LDAP myself, so take this with a grain of salt.

from kafka-webview.

Crim avatar Crim commented on May 29, 2024

Yea, let me do some research and understand the most common way ldap is integrated. I followed this tutorial which may or may not have been the best reference.

from kafka-webview.

Crim avatar Crim commented on May 29, 2024

So digging it looks like SpringBoots out of the box LDAP integration supports two modes of integration:

For LDAP servers with anonymous access, it connects anonymously and searches for a matching user record. I imagine this use case is not very common.

For LDAP servers that do NOT have anonymous access, you provide a management userDn and password. SpringBoot's integration will bind using these credentials, and then perform the user look as described above.

What has been described in this issue would be a third mode, where the user supplied credentials are used to bind to LDAP. Assuming LDAP accepts those credentials and the bind is successful, the above search would be performed to find the matching user's groups. From looking online it appears as tho this is not supported out of the box, but likely possible to implement with a bit of custom coding.

from kafka-webview.

OlivierTarnus avatar OlivierTarnus commented on May 29, 2024

@Crim ,

Your analysis is right for connecting to the LDAP server: the application need to authenticate if server doesn't allow anonymous binding.

The problem here is more to actually authenticate the users connecting to kafka-webview, and more precisely to overcome the limit imposed by most seriously configured LDAP servers: you can't retrieve password hashs, so no local compare is possible within kafka-webview.

The most common way to get around this is exactly what you described before::
_* User enters credentials in web app

  • Server takes those credentials and attempts to bind/connect to LDAP using them.
  • If LDAP rejects the credentials, user is NOT authenticated.
  • If LDAP accepts the credentials, user IS authenticated._

-> In this context, there is no need to use a separate Bind DN for the application itself...

Once you are connected as this user, you can query his group membership (for Active Directory, all the memberOf fields of the user record).

from kafka-webview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.