I have configured a JNDIRealm in tomcats server.xml
<Realm className="org.apache.catalina.realm.JNDIRealm"
connectionURL="ldaps://xxx"
alternateURL="ldaps://xxx"
userBase="xxx"
userSearch="SamAccountName={0}"
userSubtree="true"
roleBase="xxx"
roleName="CN"
roleSearch="(member={0})"
connectionName="xxx"
connectionPassword="xxx"
/>
I would like to perform further ldap queries in some JSP files (like getting email of the user, or full username)
how can I access this realm from a JSP file?
basically I would like to have a LdapContext
, which I can use for my existing ldap query code.