0

I'm using this as a Authentication to my LDAP.

      @Override
      public void configure(AuthenticationManagerBuilder auth) {
          ActiveDirectoryLdapAuthenticationProvider adProvider =
                  new ActiveDirectoryLdapAuthenticationProvider("domain.com", "ldap","ou,dc");
          adProvider.setConvertSubErrorCodesToExceptions(true);
          adProvider.setUseAuthenticationRequestCredentials(true);
          auth.authenticationProvider(adProvider);
      }

Everything works fine.

Now, I'm trying to get a list with all the groups where the given user is member of (or other personnal information too such as username, e-mail, etc.).

Is it possible do it with this kind of Authentication method ?

I searched a way to return the user's group but I didn't find any that works with this method.

Any help ? Or any documentation that can help me to find it ?

Louis Chopard
  • 334
  • 1
  • 11
  • The purpose of this method is to authenticate a given user against LDAP. `AuthenticationManagerBuilder ` is used to just help with authentication by specifying details such as dn and groups. You cant use it to return User information. – JCompetence Apr 04 '22 at 10:42
  • @SMA Thank's ! That is what I thought but I wasn't sure. Is it an other way to get those infos with a given username ? (And keep this auhenticate's method). – Louis Chopard Apr 04 '22 at 10:48
  • 1
    see if this helps https://stackoverflow.com/questions/54242165/do-we-need-to-write-customactivedirectoryldapauthenticationprovider-if-we-want-t https://stackoverflow.com/questions/54134099/spring-boot-ldap-authentication-getting-user-data-at-authentication – JCompetence Apr 04 '22 at 10:48

0 Answers0