DirContextOperations - null

So I have an application that works great on my desktop and also works great when deployed to tomcat on a windows machine. However, when I try to use this application while deploying it on the same tomcat version but on AIX, it cannot fetch data from LDAP.

The user can successfully authenticate, but the context is null. DirContextOperations

is passed to mine ContextMapper

as null. Does anyone know what ports should be open to receive this data or what other configuration might be needed? Based on what I can see this is a server config issue.

+3


source to share


2 answers


If you are using the Spring Security LDAP plugin then it will be easy to wire the below configuration on AIX to your application.I have prepared a few snapshots for the configuration so that I don't clutter up the answer space here. Look at the LDAP configuration on AIX and try installing it on the AIX server.

Now, coming to the LDAP plugin, you don't need to do anything but configure a bunch of properties. The values ​​for these properties will be available after configuring LDAP on AIX (as mentioned earlier in this slide).

Note: -
After creating standalone LDAP, you may need to add realm if user is associated with a group. I didn't mention the same in the slides as I don't have an active LDAP host available now.



UPDATE
Instead of using, BindAuthenticator

you can try switching to PasswordComparisonAuthenticator

for authentication. Using the below setting in Config, you can use PasswordComparisonAuthenticator

to authenticate and fallback DirContextOperations

. Can you try this setting?

grails.plugins.springsecurity.ldap.authenticator.useBind = false

@Refer Implementations of LdapAuthentication .

0


source


I'm not sure if this will be the answer in your case. I was also getting null in DirContextOperations when trying to get values ​​from Active Directory.

I was trying to get ldap attributes like this as the Grails LDAP plugin documentation says:

String mail = ctx.originalAttrs.attrs['mail'].values[0]

      



and they were all empty. So I changed the line above to do this instead and it works for me:

String mail = ctx.attributes.getAt('mail').values[0].toString()

      

0


source







All Articles